PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Error Codes From Oracle

Reply

Error Codes From Oracle

 
Thread Tools Rate Thread
Old 09-02-2006, 12:34 AM   #1
tim.romanowski@gmail.com
Guest
 
Posts: n/a
Default Error Codes From Oracle


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

  Reply With Quote
Old 09-02-2006, 02:30 AM   #2
Val Mazur \(MVP\)
Guest
 
Posts: n/a
Default Re: Error Codes From Oracle

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

--
Val Mazur
Microsoft MVP
http://xport.mvps.org


<tim.romanowski@gmail.com> wrote in message
news:1139445276.932771.284890@g44g2000cwa.googlegroups.com...
> 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
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off