Hi, i have created a trigger that check for a value if it has duplicate values...it should abort a the operation that caused the tirigger. but it dont seem to work.
CREATE TRIGGER tg_pbasketInsert
BEFORE INSERT ON pbasket
FOR EACH ROW
DECLARE
cnt number;
BEGIN
SELECT count(ccard) into cnt from pbasket where ccard = :new.ccard;
if cnt > 0 then
RAISE_APPLICATION_ERROR(-1
0000, 'Credit Card already in use!');
end if;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLER
RM);
END tg_pbasketInsert;
.
run;
Start Free Trial