Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> OCI, how to detect a no_data_found with an update

OCI, how to detect a no_data_found with an update

From: JosÚ Delfosse <jdelfosse_at_free.fr>
Date: Wed, 9 Jun 2004 23:17:47 +0200
Message-ID: <40c77e7f$0$13821$626a14ce@news.free.fr>


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:17:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US