Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> OCI, how to detect a no_data_found with an update
Hi,
I have a C++ application developed on IBM AIX 4.3.3 with Oracle 8.1.7.4 that use OCI to access the database.
I have a loop on an update-statement that update different rows in a table.
During the loop, it might happen that a row is not to be updated because it does not exist.
After each OCIStmtExecute(), I call the OCIAttrGet() APÏ to retrieve the OCI_ATTR_ROW_COUNT attribute in order to know how many rows were updated (I expected one or zero in my case). My goal is to detect which rows were not updated (because they don't exist).
While it returns 0 before the first OCIStmtExecute() , I found out that this attribute thereafter always return 1 even if the update found no rows.
Moreover, OCIStmtExecute() returns OCI_SUCCESS even when the update found no rows.
In fact, the OCI_ATTR_ROW_COUNT seems to work fine only with fetch-statement.
So, using OCI, does anyone know how to detect that an update statement found no rows ?
(just like the WHEN NO_DATA_FOUND of Pro*C or PL/SQL)
Many thanks to any experts willing to answer me.
JD Received on Wed Jun 09 2004 - 16:19:58 CDT