Re: [GENERAL] SELECT @@IDENTITY

2003-06-23 Thread Franco Bruno Borghesi
I always use Steve's method (it's easier), but if you still want to do it in the sql-server way, you can use OIDs to fetch the id of the last INSERTed row. I don't know which programming language you are using, but are some examples: *plpgsql DECLARE    myOid INTEGER;    identity

Re: [GENERAL] SELECT @@IDENTITY

2003-06-23 Thread Ian Harding
It would be nice. keep table names short, name id columns the tablename plus "id", and let PG assign sequence names, so I can write: set sql "select currval(${tablename}_${tablename}id_seq) as lastid" in pltcl. In other words, create table foobar ( foobarid serial primary key, otherf

Re: [GENERAL] SELECT @@IDENTITY

2003-06-23 Thread Steve Lane
On 6/23/03 12:58 PM, "Robert J. Sanford, Jr." <[EMAIL PROTECTED]> wrote: > Okay, I did a quick search through both the general and SQL lists(1,2) > trying to determine if there is a PostgreSQL construct equivalent to > Microsoft SQL Server's "SELECT @@IDENTITY". After performing an insert the > da

[GENERAL] SELECT @@IDENTITY

2003-06-23 Thread Robert J. Sanford, Jr.
Okay, I did a quick search through both the general and SQL lists(1,2) trying to determine if there is a PostgreSQL construct equivalent to Microsoft SQL Server's "SELECT @@IDENTITY". After performing an insert the database caches the last sequence number for each connection and the select retrieve