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.??
insert a db2 sequence generated value
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 43
- Joined: Mon Jan 15, 2007 10:53 pm
Re: insert a db2 sequence generated value
There wouldn't be any select clause; take the value directly from the said sequence.ajmore wrote: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.??
Regards,
Vivek D. Reddy
__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
Vivek D. Reddy
__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov