Translating error messages

remq

Member
Hello,
In my Delphi application I use TOracleDataset with usemessagetable=true in order to display translated error messages.
However, some operations are executed through PL-SQL code and I need to catch exceptions returned when executing stored procedures by TOraclePackage component.
In my PL-SQL code I throw exceptions like this:

RAISE_APPLICATION_ERROR(-20001,'MY_OWN_VIRTUAL_CONSTRAINT_NAME')

where 'MY_OWN_VIRTUAL_CONSTRAINT_NAME' is the name of constraint which doesn't really exists, but is written in table used by TSession.MessageTable

Is there any possibility to catch these exceptions in DOA and translate them similiarly to using message table?
 
This is only possible by writing an OnOracleError event handler. In this event handler you can recoginze the ORA-20001 error number, and translate the message based on the text.

See the EOracleError help topic for more information about the OnOracleError event.
 
Back
Top