| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера