PLSQL Question regarding multiple inserts

Поиск
Список
Период
Сортировка
От Humble Geek
Тема PLSQL Question regarding multiple inserts
Дата
Msg-id ZfV_b.60$Yf.1@twister01.bloor.is.net.cable.rogers.com
обсуждение исходный текст
Ответы Re: PLSQL Question regarding multiple inserts  (Martijn van Oosterhout <kleptog@svana.org>)
Re: PLSQL Question regarding multiple inserts  (Richard Huxton <dev@archonet.com>)
Re: PLSQL Question regarding multiple inserts  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
Hi all. Quick and perhaps silly question, but...

I am using Pg 7.3. I am writing a function using pgplsql. This function will
perform multiple inserts. Let's say two of the inserts are as follows:

-- id is primary key
insert into users (id, username) values (nextval('someSeq'),'somename');

-- id is also a PK
insert into log (id, uid, message) values (nextval('someOtherSeq'),XXX,'New
Account');

Assume XXX is the id from the first insert. How do I get that number? Not
currval('someSeq') -  'cause someone else may have performed an insert - but
the id for that specific insert.

Thanks,

HG

PS: Sorry for the cross-post...



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

Предыдущее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: [HACKERS] select statement against pg_stats returns
Следующее
От: "Greg Patnude"
Дата:
Сообщение: Re: PLSQL Question regarding multiple inserts