On Sun, Aug 21, 2005 at 12:56:27 -0700, "Matt A." <survivedsushi@yahoo.com> 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
>
>
> POSTGRESQL
> *cricket cricket* :)
>
>
> How is this done? By a trigger function? Or is it
> natively supported? Could I get an example on how to
> do it too?
Use a serial type for the column and use currval to get the last value
assign to the corresponding sequence in the current session.
You probably want to read the documentation section on sequences.
http://candle.pha.pa.us/main/writings/pgsql/sgml/functions-sequence.htmlhttp://candle.pha.pa.us/main/writings/pgsql/sgml/datatype.html#DATATYPE-INT