Error Codes From Oracle

T

tim.romanowski

Hello,

I am having a wierd problem. I am using an OleDBCommand to insert a
new row into a table on an Oracle 10g database.

My Code looks like this

bool result = ( command.ExecuteNonQuery( statement ) > 0 );

last night the Oracle Database was hung due to some issues with the
file sizes or something
I am not sure .

The problem is, is that all of the inserts in my code passed, meaning
that result was true,
and no exceptions where thrown.

is there a way to get a return / error code from the ExecuteNonQuery()?


All I have read says that the return is the number of rows affected.
if this returns 1 but Oracle did not actually insert the row, the only
way for me to tell is to select back out the row to make sure it is
there. I kinda do not want to do that.

Any help would be appreciated

thank you in advance

Tim
 
V

Val Mazur \(MVP\)

Hi Tim,

In a case of error, ExecuteNonQuery suppose to throw an exception. You do
not need to check for error. If you are sure that ExecuteNonQuery returns 1
and database is not updated, then it looks like a bug in a provider or
something is wrong on a database side. Another potential issue is the if
inserts were done inside of the transaction, then ExecuteNonQuery returned 1
for each insert, but transaction was automatically rolled back after server
crashed. In this case you will not see any updates in a database
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top