Ayusman ,
Seems like u have encountered minor syntactical error
> insert into t values (next value for s)
> [
> WHERE t is a table with single column of integer type.
> s is a sequence I creates, which shows in the sysibm.syssequences.
> ]
It should have been
insert into t values (NEXTVAL for s)
Much of the information can be found at
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.
udb.doc/ad/c0007007.htm
> gives me error saying "for" is an unidentified token.
>
[quoted text clipped - 11 lines]
> Ayusman's Profile: http://www.dbtalk.net/m98
> View this thread: http://www.dbtalk.net/t296807
Serge Rielau - 03 Apr 2006 21:36 GMT
> Ayusman ,
> Seems like u have encountered minor syntactical error
[quoted text clipped - 8 lines]
> Much of the information can be found at
> http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.
udb.doc/ad/c0007007.htm
Note that NEXT VALUE FOR <seqname> is the SQL Standard syntax.
NEXTVAL was the syntax chosen by DB2 prior to sequences being added to
the SQL Standard.
So, moving forward please use NEXT VALUE FOR and PREVIOUS VALUE FOR for
compliance. NETXVAL and PREVVAL remain of course supported for backward
compatibility.
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Ayusman - 05 Apr 2006 08:21 GMT
Thanks a lot.
I was facing this proble.
But why does it work in db2 8.1.7?
--
Ayusma