Hi,
In the CLI guide and reference i've read about the possibility of getting status
information when using arrays to input parameter values. This i've achieved as
described with the SQL_ATTR_PARAM_ STATUS_PTR attribute of the SQLSetStmtAttr( )
function.
I'm trying to do a bulk INSERT and if there are already records in the target
table, i want to update those records that were already present. Depending on
the status information just received i filled an SQLUSMALLINT* array with
SQL_PARAM_PROCE ED or SQL_PARAM_IGNOR E for telling DB2 (with the
SQL_ATTR_PARAM_ OPERATION_PTR attribute of SQLSetStmtAttr( )) which records to
ignore when executing the SQL statement for the bulk UPDATE. This is were the
problem arises, i can't seem to make this bulk UPDATE work correctly. I'm
getting error message: [IBM][CLI Driver][DB2/LINUX] SQL0100W No row was found
for FETCH, UPDATE or DELETE; or the result of a query is an empty table.
SQLSTATE=00000.
But the destination table isn't empty, i've checked this a thousand times. I
also put on the tracing and you can actually see what DB2 wants to execute,
which are the exact records that already are in the destination table. In the
attachment i've described the table's structure and content, furthermore i've
added the error from the DB2DIAG.LOG file and the tracings that DB2 has
generated while executing my program.
Does anybody has experience with this kind of bulk INSERT/UPDATE actions???
Can someone give me an example of how i should do this or tell me what i'm
overlooking here.
Thanks in advance!!!
Davy Faassen
In the CLI guide and reference i've read about the possibility of getting status
information when using arrays to input parameter values. This i've achieved as
described with the SQL_ATTR_PARAM_ STATUS_PTR attribute of the SQLSetStmtAttr( )
function.
I'm trying to do a bulk INSERT and if there are already records in the target
table, i want to update those records that were already present. Depending on
the status information just received i filled an SQLUSMALLINT* array with
SQL_PARAM_PROCE ED or SQL_PARAM_IGNOR E for telling DB2 (with the
SQL_ATTR_PARAM_ OPERATION_PTR attribute of SQLSetStmtAttr( )) which records to
ignore when executing the SQL statement for the bulk UPDATE. This is were the
problem arises, i can't seem to make this bulk UPDATE work correctly. I'm
getting error message: [IBM][CLI Driver][DB2/LINUX] SQL0100W No row was found
for FETCH, UPDATE or DELETE; or the result of a query is an empty table.
SQLSTATE=00000.
But the destination table isn't empty, i've checked this a thousand times. I
also put on the tracing and you can actually see what DB2 wants to execute,
which are the exact records that already are in the destination table. In the
attachment i've described the table's structure and content, furthermore i've
added the error from the DB2DIAG.LOG file and the tracings that DB2 has
generated while executing my program.
Does anybody has experience with this kind of bulk INSERT/UPDATE actions???
Can someone give me an example of how i should do this or tell me what i'm
overlooking here.
Thanks in advance!!!
Davy Faassen