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
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
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
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