Oracle error codes

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply

Oracle error codes

Post by Guest » Mon 30 May 2005 07:24

Is there any way to get the last Oracle error code from the driver?

I know that lack of error codes is DbExpress' limitation, but is there any workaround for this with your Oracle driver? May be some Oracle SQL statement can do this?



Oracle error codes

Post by Guest » Mon 30 May 2005 09:45

If parsing the error string is the only solution, could you please modify the error message the driver generates to something like the following:

DbxOda error:

This way it will be easy to parse the error code out of the string - the error code will always be formatted the same way by the driver (oracle error messages can be localized).
Also, the 'DbxOda' string in the message will allow to easy tell apart driver's messages and dbexpress' own messages.

Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Tue 31 May 2005 13:40

Oracle errors have recognizable format. For example

Exception.Message = 'ORA-00942: table or view does not exist'

= 00942
= table or view does not exist

Sometimes you can get error message from "Oracle Net (Core Lab)" in the following format (starting from "NET:")
Exception.Message = 'NET: Invalid host'

Post Reply