Re: currval() without specifying the sequence name

Поиск
Список
Период
Сортировка
От Achilleus Mantzios
Тема Re: currval() without specifying the sequence name
Дата
Msg-id Pine.LNX.4.44.0403091610190.32587-100000@matrix.gatewaynet.com
обсуждение исходный текст
Ответ на currval() without specifying the sequence name  (ow <oneway_111@yahoo.com>)
Ответы Re: currval() without specifying the sequence name  (ow <oneway_111@yahoo.com>)
Список pgsql-sql
O kyrios ow egrapse stis Mar 9, 2004 :

> Hi,
> 
> Is there a way to retrieve the current value (i.e. the last used value) of the
> last used sequence without specifying the sequence name? Something like the
> following:
> 
> create table ( id serial, value varchar(10));
> insert into someOthertest (value) values ('100');
> insert into test (value) values ('10');
> insert into test (value) values ('20');
> 
> select currval() should returns 2 (the last value of the test table sequence)

You could use the same sequence in many tables.

> 
> Thanks
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Search - Find what you’re looking for faster
> http://search.yahoo.com
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 

-- 
-Achilleus



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

Предыдущее
От: ow
Дата:
Сообщение: currval() without specifying the sequence name
Следующее
От: ow
Дата:
Сообщение: Re: currval() without specifying the sequence name