Re: Casting with character and character varying

Поиск
Список
Период
Сортировка
От Jeff Eckermann
Тема Re: Casting with character and character varying
Дата
Msg-id 20030319145925.37042.qmail@web20802.mail.yahoo.com
обсуждение исходный текст
Ответ на Casting with character and character varying  ("David Loh" <david@bizsurf.com>)
Список pgsql-sql
--- David Loh <david@bizsurf.com> wrote:
>   else
>   select into Rec * from tableA where user_name =
> trim(trailing '' '' from
> cast(NEW.user_name as varchar)) and user_type =
> ''T'';
>    if not found then
>     return NEW;
>    end if;
> 
>    insert into temptable values (tableA.FieldA);

This last statement inserts every record from tableA
into temptable.  This follows from the PostgreSQL
"implicit from-clause" feature, whereby "select
tableA.FieldA" is equivalent to "select FieldA from
tableA".

What you want is to refer to "Rec.FieldA", which will
give you the single value that you are looking for.

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tomasz Myrta
Дата:
Сообщение: Re: vacuum all but system tables
Следующее
От: Victor Yegorov
Дата:
Сообщение: Re: vacuum all but system tables