I required how to manage error messages and marco kalter's reply was very good (use of Session.MessageTable).
My problem now is how to show proper message when an error occurs in a trigger.
My standard trigger code is similar to:
CREATE OR REPLACE TRIGGER MyTrigger
BEFORE INSERT ON MyTable
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
MyError Exception;
N Number;
BEGIN
SELECT Count(*) INTO N
FROM MyTable T
WHERE :NEW.ID_UI=T.ID_UI AND
T.ANNO=:NEW.ANNO;
if N=0 then
RAISE MyError;
end if;
END;
But i don't know how to display proper message when trigger error raises.
Any suggestions (also how can I change triggers to raise an arror that can be intercepted through MessageTable).
Fabiano
My problem now is how to show proper message when an error occurs in a trigger.
My standard trigger code is similar to:
CREATE OR REPLACE TRIGGER MyTrigger
BEFORE INSERT ON MyTable
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
MyError Exception;
N Number;
BEGIN
SELECT Count(*) INTO N
FROM MyTable T
WHERE :NEW.ID_UI=T.ID_UI AND
T.ANNO=:NEW.ANNO;
if N=0 then
RAISE MyError;
end if;
END;
But i don't know how to display proper message when trigger error raises.
Any suggestions (also how can I change triggers to raise an arror that can be intercepted through MessageTable).
Fabiano