SQL Help - Obtaining ID of record INSERTED

Поиск
Список
Период
Сортировка
От josh@segrestfarms.com
Тема SQL Help - Obtaining ID of record INSERTED
Дата
Msg-id 430255F0.7060500@segrestfarms.com
обсуждение исходный текст
Ответы Re: SQL Help - Obtaining ID of record INSERTED  (Juan Miguel Paredes <juan.paredes@gmail.com>)
Re: SQL Help - Obtaining ID of record INSERTED  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: SQL Help - Obtaining ID of record INSERTED  (Ben Kim <bkim@coe.tamu.edu>)
Re: SQL Help - Obtaining ID of record INSERTED  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-admin
Greetings.

INSERT INTO
    orderstemp (customerid,datecreated)
VALUES
    ('5443','8/16/2005 12:00PM')

The table orderstemp has a unique identifier field, orderid (of type
SERIAL).

How can I obtain the orderid of the record inserted in the INSERT INTO
statement in postgresql?

MSSQL does it like this:

INSERT INTO
    orderstemp (customerid,datecreated)
VALUES
    ('5443','8/16/2005 12:00PM')
SELECT @@identity as orderid

but this doens't work in postgresql.

Any ideas?  Thanks in advance.

В списке pgsql-admin по дате отправления:

Предыдущее
От: Chris Hoover
Дата:
Сообщение: Is there anyway to create a functional index using to_date?
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Is there anyway to create a functional index using to_date?