There is a functionality in Sybase that a user would be able to raise error and passing parameters into a predefine error message, is there similar things in Oracle?.
This is what's in the Sybase Trigger:
if exists ( select 1
from deleted d,
where d.UserID=l.UserID )
raiserror 21006 '','trigger','TRD_xxx','abc'
This is what's in the predefined error message:
if exists (select error from sysusermessages where error=21006)
exec sp_dropmessage 21006
sp_addmessage 21006, "Restricted Delete Error from %1! code %2!: Can not delete because rows exist in child table %3! !"
This is the actual error message in Sybase in which the %n is replaced by the parameters from the first statement:
raiserror 21006 '','trigger','TRD_xxx','abc':
Server Message: Number 21006, Severity 16
Procedure 'TRD_xxx', Line 24:
Restricted Delete Error from trigger code TRD_xxx: Can not delete because rows exist in child table abc !
(1 row affected)
Please advise, thanks.
Click Here to Expand Forum to Full Width