Re: [SQL] returning inserted id

2005-08-27 Thread Havasvölgyi Ottó
Matt, This is how you can do it: create function person_ins(_name text) returns integer language plpgsql as $$ declare insert_id integer; begin insert into person (name) values(_name); select into insert_id currval('person_id_seq'); return insert_id; end; $$; Or perhaps even better: you return

Re: [SQL] returning inserted id

2005-08-26 Thread Bruno Wolff III
On Sun, Aug 21, 2005 at 12:56:27 -0700, "Matt A." <[EMAIL PROTECTED]> wrote: > this may have been asked a thousand times but i > haven't found a standard answer... > > > MSSQL > set nocount on > insert into (column) values (value) > select identityid = @@identity > set nocount off > > > POSTG