AS400 Sequence at Insert
Posted: Tue Apr 22, 2008 12:56 am
Hi, This really should not be that complex, but I am having trouble getting it to work.
I am trying to invoke a sequence at insert time in AS400, but my client prefers to use a sequence created in AS400 rather than the KeyMgtGetNextValue routine.
I have been using the following sql in the ODBC stage:
INSERT INTO <library>.<table>
(<field1>,...<fieldn>)
VALUES (next value for <table>_key,?,?,?,?,?,?,?,?,...,?);
And I am getting errors (Undefined name, invalid symbol, etc depending on what variant of the above I enter)
I have verified the required AS400 libraries have been added to the user, so that should not be the issue. Is it something in the SQL syntax?
thanks!
W
I am trying to invoke a sequence at insert time in AS400, but my client prefers to use a sequence created in AS400 rather than the KeyMgtGetNextValue routine.
I have been using the following sql in the ODBC stage:
INSERT INTO <library>.<table>
(<field1>,...<fieldn>)
VALUES (next value for <table>_key,?,?,?,?,?,?,?,?,...,?);
And I am getting errors (Undefined name, invalid symbol, etc depending on what variant of the above I enter)
I have verified the required AS400 libraries have been added to the user, so that should not be the issue. Is it something in the SQL syntax?
thanks!
W