insert a db2 sequence generated value
Posted: Wed Jan 17, 2007 2:17 am
Hi all ,
I have to insert a db2 sequence generated value into a field for a table(say ABC),the sequence name is IA.INDIV_EN_ID_SEQ
INSERT INTO #TgtDB#.ABC
(IDENTITY_ID, INDIVIDUAL_ENTITY_ID)
VALUES
(ORCHESTRATE.IDENTITY_ID, NEXTVAL FOR IA.INDIV_EN_ID_SEQ)
But while doing this i am getting the following error
An unexpected token "NEXT" was found following "L_ENTITY_ID = SELECT". Expected tokens may include: "WHERE". SQLSTATE=42601.
Is this the proper method to insert seq. generated value in a Col.??
I have to insert a db2 sequence generated value into a field for a table(say ABC),the sequence name is IA.INDIV_EN_ID_SEQ
INSERT INTO #TgtDB#.ABC
(IDENTITY_ID, INDIVIDUAL_ENTITY_ID)
VALUES
(ORCHESTRATE.IDENTITY_ID, NEXTVAL FOR IA.INDIV_EN_ID_SEQ)
But while doing this i am getting the following error
An unexpected token "NEXT" was found following "L_ENTITY_ID = SELECT". Expected tokens may include: "WHERE". SQLSTATE=42601.
Is this the proper method to insert seq. generated value in a Col.??