Re: how to use nextval()

Поиск
Список
Период
Сортировка
От Stephane Schildknecht
Тема Re: how to use nextval()
Дата
Msg-id 1025872101.10925.289.camel@fukse
обсуждение исходный текст
Ответ на how to use nextval()  (juerg.rietmann@pup.ch)
Список pgsql-sql
Le ven 05/07/2002 à 14:03, juerg.rietmann@pup.ch a écrit :
> Hello there
>
> I have an idea how to solve my problem on copy a record to a new one in the
> same table. To do so I need the next value for the primary key.
>
> Using :
>
> select nextval('pk_auftrag') as nextkey from auftrag;
>
> I get an error like : Relation pk_auftrag does not exist !
>
> Thanks for any help ... jr
Try to get the right name of the sequence.
By default, something like auftrag_auftrag_id_seq, if auftrag_id is the
serial primary key.

select nextval('auftrag_auftrag_id_seq') as nextkey;

S@S





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

Предыдущее
От: Chantal Ackermann
Дата:
Сообщение: Re: Selecting data from a table created in another database...
Следующее
От: Achilleus Mantzios
Дата:
Сообщение: Re: how to use nextval()