Re: [GENERAL] getting the currval of a sequence

Поиск
Список
Период
Сортировка
От James Oden
Тема Re: [GENERAL] getting the currval of a sequence
Дата
Msg-id 004201bdc775$e78201c0$01cc0cac@Yehudah.lee.k12.nc.us
обсуждение исходный текст
Список pgsql-general

>On Fri, 14 Aug 1998, Fran Fabrizio wrote:
>
> If you've recently done an insert and want to know what the value
>was, you can do this:
>
> select last_value from mysequence;

Alternatively, you can get your key from the sequence before you insert, and
override the default value of the key (they will be the same only now you
explicitly got it).  Now that you know what the key value use, after you
insert it you can do anything you want to with it.  To do this just do:

   select nextval ('sequencename');

...james


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

Предыдущее
От: "Philippe Selo"
Дата:
Сообщение: subscribe pgsql-general
Следующее
От: "윤영철"
Дата:
Сообщение: ...