Re: SQL-question: returning the id of an insert querry

Alvaro Herrera <alvherre@dcc.uchile.cl>

From: Alvaro Herrera <alvherre@dcc.uchile.cl>
To: Scott Chapman <scott_list@mischko.com>
Cc: Doug McNaught <doug@mcnaught.org>, pgsql-general@postgresql.org
Date: 2003-11-12T20:20:32Z
Lists: pgsql-general
On Wed, Nov 12, 2003 at 11:46:44AM -0800, Scott Chapman wrote:
> On Wednesday 12 November 2003 11:29, Doug McNaught wrote:
> >
> > Write a database function that inserts the record and returns the
> > primary key value?  That's probably the best way to insulate your app
> > from the database structure...
> 
> The function still has to know which sequence to pull from doesn't it?

Yes, but it could pull it from the system catalogs ... (not too
portable)

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"No necesitamos banderas
No reconocemos fronteras"                  (Jorge González)