I want to insert rows using loop, but it seems not work in DataDirect (but Sybase ODBC Driver and TDS works)
dbStatement<<"INSERT INTO CSMRECOVER VALUES(?,0,0)",use(groupNo);
for (groupNo=0; groupNo < numOfGroup; groupNo++) {
dbStatement.execute();
I set DescribeAtPrepare=1 and it still not work.
DataDirect Version : 7.1.3 DB: Sybase ASE 15.0.3
Does DataDirect ODBC to Sybase ASE support dynamic sql statment?
Is the below statement inside the for loop ? Not clear from the above whether the statement is inside the for loop. Please try putting it inside the for loop, in case it's not there already
dbStatement<<"INSERT INTO CSMRECOVER VALUES(?,0,0)",use(groupNo);
Regards,
~JK
What happens when you execute the example you provided? Do you get an error message?
The result is :
The ? values remain consistent in the loop, so insert table will got dulplicate key after the second insert attempt.
I expect it will generate sequecne number in each insert command under the loop