Re: [SQL] Selecting Current value from a sequence

2001-01-18 Thread Josh Berkus
Bruce, > > BTW, O'Reilly's "SQL in at Nutshell" also catalogs all PGSQL functions > > from ver. 6.5. > > It does, or only the standard SQL functions? Do they have > PostgreSQL-specific stuff. Both. The book is set up to cover 1) the SQL99 standard, and 2) Specific variants for SQL Serve

Re: [SQL] Selecting Current value from a sequence

2001-01-18 Thread Josh Berkus
Clayton, > > Hi all, > > It is a very simple but I am not able to recall how to do it I > > just need to find out the current value of a seq. It is very simple > > select statement but I can't recall it... Help me please before I get > > myself get fired -:). > > Regards, Najm > > select

Re: [SQL] Selecting Current value from a sequence

2001-01-18 Thread Najm Hashmi
Thank you all for your help. Najm

Re: [SQL] Selecting Current value from a sequence

2001-01-18 Thread Bruce Momjian
See my book on sequences: http://www.postgresql.org/docs/awbook.html currval() is probably what you need. > Hi all, > It is a very simple but I am not able to recall how to do it I > just need to find out the current value of a seq. It is very simple > select statement but I can'

Re: [SQL] Selecting Current value from a sequence

2001-01-18 Thread clayton cottingham
Najm Hashmi wrote: > > Hi all, > It is a very simple but I am not able to recall how to do it I > just need to find out the current value of a seq. It is very simple > select statement but I can't recall it... Help me please before I get > myself get fired -:). > Regards, Najm select nex

Re: [SQL] Selecting Current value from a sequence

2001-01-18 Thread Bruce Momjian
> Najm > > CURRVAL('sequence_name') > > For this and other sequence and serial functions, please see the online > version of Bruce's book. > > BTW, O'Reilly's "SQL in at Nutshell" also catalogs all PGSQL functions > from ver. 6.5. It does, or only the standard SQL functions?

Re: [SQL] Selecting Current value from a sequence

2001-01-18 Thread George Moga
Najm Hashmi wrote: > Hi all, > It is a very simple but I am not able to recall how to do it I > just need to find out the current value of a seq. It is very simple > select statement but I can't recall it... Help me please before I get > myself get fired -:). > Try: SELECT last_value FRO

Re: [SQL] Selecting Current value from a sequence

2001-01-18 Thread Josh Berkus
Najm CURRVAL('sequence_name') For this and other sequence and serial functions, please see the online version of Bruce's book. BTW, O'Reilly's "SQL in at Nutshell" also catalogs all PGSQL functions from ver. 6.5. -Josh Berkus --

[SQL] Selecting Current value from a sequence

2001-01-18 Thread Najm Hashmi
Hi all, It is a very simple but I am not able to recall how to do it I just need to find out the current value of a seq. It is very simple select statement but I can't recall it... Help me please before I get myself get fired -:). Regards, Najm