EOracleError

hdv

Member
i'm using Builder 5.0 with Oracle 8i.
i need to catch the OracleError exception but instead i allways get a DatabaseError exception.
If i'm debugging my code and i force an error i see the EOracleError but when i continue
with the execution i inmediatly see the EDatabaseError, and i never get the chance to catch
the first error.

The problem is that when i catch the database error i lost a lot of information about the error.
 
I have the same problem. I looked into it for a while some months back, and I vaguely remember concluding that it's the fault of the VCL. It seemed to be catching the OracleError and rethrowing it as a DatabaseError (minus all the information about what caused the error in the first place, possibly because it cannot see the OracleError as an EDBEngineError). I tried using TDBEngineErrorDlg to at least show me the full error stack, but couldn't get that to work at all.
I don't think this is neatly resolvable, but I hope I'm wrong.

Originally posted by hdv:
i'm using Builder 5.0 with Oracle 8i.
i need to catch the OracleError exception but instead i allways get a DatabaseError exception.
If i'm debugging my code and i force an error i see the EOracleError but when i continue
with the execution i inmediatly see the EDatabaseError, and i never get the chance to catch
the first error.

The problem is that when i catch the database error i lost a lot of information about the error.

------------------
Frans
 
For TDataSet compatibility reasons all EOracleError exceptions raised in the TOracleDataSet are translated into a EDatabaseError. This is the exception you need to catch.

For user defined errors (ORA-20000 through ORA-20999) the error stack is stripped when it is translated to an EDatabasError. The idea is that an error stack of trigger and program units is not really meaningful to an end-user. A developer can always see the full error stack, either in the Delphi/C++Builder IDE, or in the Oracle Monitor.

------------------
Marco Kalter
Allround Automations
 
OK, the VCL wasn't doing it, but DOA. I realize why this is necessary, of course, but hdv's problem is probably my problem also, namely that the information in DatabaseError is not nicely structured. This makes it impossible to pick up the Oracle error number in a neat way. At least, I don't think looking for the string "ORA" in the error message and parsing the number following is neat!
Would Allround Automations consider adding the last Oracle error number as a read-only property to the appropriate components at some time in the future?

------------------
Frans
 
Back
Top