Re: [GENERAL] returning the primary key value

2005-09-22 Thread vishal saberwal
hi, If this primary key is a guid or a number that you create as unique, create it local to your function and then return the same after inserting within the function. create or replace function test_insert() returns guid as $$ DECLARE  ret guid; BEGIN    select into ret newid();    -- ret is the

Re: [GENERAL] returning the primary key value

2005-09-21 Thread Michael Fuhr
On Wed, Sep 21, 2005 at 02:22:22PM -0500, Jason Tesser wrote: > I have a stored proc in which I want to retur the primary key of > an insert statement that the stored proc just ran. How can I do > that? If the primary key is a SERIAL column then see "How do I get the value of a SERIAL insert?" i