am Fri, dem 11.04.2008, um 19:23:04 +0200 mailte Nacef LABIDI folgendes:
> Hi all,
>
> I was wondering if postgres can return the last ID inserted for a table which
> the primary key is autoincremented. I need to retrieve this ID in my code to
> continue processing on that inserted row.
Either with RETURNING:
http://www.postgresql.org/docs/current/static/sql-insert.html
or with currval():
http://www.postgresql.org/docs/current/static/functions-sequence.html
HTH, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net