--- 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