Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Raise exception with parameters

-K-May 18 2007 — edited May 21 2007
Hi,

Does anyone know how to hook into raising (predefined) exceptions with parameters?
In a distributed environment I have to write my integrity constraints in triggers. For example, upon deleting, I throw an ORA-02292 myself if a child record exists inside a remote table (PRAGMA EXCEPTION_INIT(CHILD_RECORD_FOUND, -2292)). This results in the message ORA-02292: integrity constraint (.) violated - child record found.
How do I pass someting to the %s parameter of the message? I'd like it to say ORA-02292: integrity constraint (MY_TRIGGER.REMOTE_TABLE) violated - child record found.
If I throw the "stripped" ORA-02292, users won't have a clue as to what's failing.
If I throw a user defined exception, I lose the ORA number, resulting code written specifically to handle these to start failing.
Sure, updating all our exception handlers would be an option... NOT!

Thanks,
K.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2007
Added on May 18 2007
5 comments
1,843 views