Re: kinda newbie - ish question

Поиск
Список
Период
Сортировка
От Marko Kreen
Тема Re: kinda newbie - ish question
Дата
Msg-id 20011011002406.A18573@l-t.ee
обсуждение исходный текст
Ответ на kinda newbie - ish question  (mmacie@earthlink.net (Mike Judkins))
Список pgsql-general
On Mon, Oct 08, 2001 at 07:31:36PM -0700, Mike Judkins wrote:
> Im trying to insert a record with a php script. I insert a NULL value
> to get my auto increment unique key to automatically populate as
> usual. Then I want to be able to insert another value in this same row
> which is a URL. This URL is basically a path plus a filename which I
> want to have the exact same name as the unique key that was just
> generated for the row. Is there a quick way is SQL to do this or will
> I have to handle it in my script?

update tbl set fn = fileprefix || currval('tbl_id_seq')
    where id = currval('tbl_id_seq')

This must be in the same TX as first insert.

--
marko


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

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: kinda newbie - ish question
Следующее
От: "H. Wade Minter"
Дата:
Сообщение: Re: Where to count