Skip site navigation (1) Skip section navigation (2)

INSERT Return Value?

From: Greg Lindstrom <greg(dot)lindstrom(at)novasyshealth(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: INSERT Return Value?
Date: 2006-12-11 20:46:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

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.

Thanks for your help,

Greg Lindstrom               501 975.4859 (office)
Programmer                   501 219-4455 (fax)
NovaSys Health               greg(dot)lindstrom(at)novasyshealth(dot)com
Little Rock, Arkansas

"We are the music makers, and we are the dreamers of dreams."  W.W.


pgsql-novice by date

Next:From: Bram KuijperDate: 2006-12-11 22:48:09
Subject: do not obtain all columns from DBD::Pg
Previous:From: Philippe SalamaDate: 2006-12-11 17:24:36
Subject: Re: delete cascade question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group