Hi all,

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?.

eg.

This is what's in the Sybase Trigger:

if exists ( select 1
from deleted d,
abc l
where d.UserID=l.UserID )
begin
rollback tran
raiserror 21006 '','trigger','TRD_xxx','abc'
return
end


This is what's in the predefined error message:


if exists (select error from sysusermessages where error=21006)
exec sp_dropmessage 21006
go
sp_addmessage 21006, "Restricted Delete Error from %1! code %2!: Can not delete because rows exist in child table %3! !"
go


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.