On 12/11/06, Greg Lindstrom <greg.lindstrom@novasyshealth.com> wrote:
> Hello-
>
> I am running Postgres 8.08 on a Linux system. When I insert data into a
> table I generate and store a value in the table via a trigger that fires
> after the insert. Is there a way to retrieve the value that I generate
> with the trigger? In this case, I am generating a broker number and
> would like to get it back. One method would be to grab the sequence
> number of the record and then make another query, but I feel there is a
> more elegant way to get the field.
>
you can migrate to 8.2 and use the new INSERT | UPDATE | DELETE
returning feature
http://www.postgresql.org/docs/8.2/static/sql-insert.htmlhttp://www.postgresql.org/docs/8.2/static/sql-update.htmlhttp://www.postgresql.org/docs/8.2/static/sql-delete.html
--
regards,
Jaime Casanova
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook