Re: SQL-question: returning the id of an insert querry

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: SQL-question: returning the id of an insert querry
Дата
Msg-id 20031112202032.GH30587@dcc.uchile.cl
обсуждение исходный текст
Ответ на Re: SQL-question: returning the id of an insert querry  (Scott Chapman <scott_list@mischko.com>)
Список pgsql-general
On Wed, Nov 12, 2003 at 11:46:44AM -0800, Scott Chapman wrote:
> On Wednesday 12 November 2003 11:29, Doug McNaught wrote:
> >
> > Write a database function that inserts the record and returns the
> > primary key value?  That's probably the best way to insulate your app
> > from the database structure...
>
> The function still has to know which sequence to pull from doesn't it?

Yes, but it could pull it from the system catalogs ... (not too
portable)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"No necesitamos banderas
No reconocemos fronteras"                  (Jorge González)

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

Предыдущее
От: Adam Ruth
Дата:
Сообщение: Re: Column Sizes
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pl/perl function life and variable scope - concurrency problem?