Disallowing INSERT using Trigger [message #36409] |
Mon, 26 November 2001 07:46 |
Nehal
Messages: 2 Registered: November 2001
|
Junior Member |
|
|
CREATE OR REPLACE TRIGGER tr_test
BEFORE INSERT ON test
FOR EACH ROW
DECLARE
BEGIN
if :new.id >= 13 then
/* COMMENTS
If this condition is true, then i need to stop the INSERT statement from executing. How to do this????
*/
end if;
END tr_test;
Thnks..
----------------------------------------------------------------------
|
|
|
Re: Disallowing INSERT using Trigger [message #36410 is a reply to message #36409] |
Mon, 26 November 2001 08:18 |
Suresh Vemulapalli
Messages: 624 Registered: August 2000
|
Senior Member |
|
|
CREATE OR REPLACE TRIGGER tr_test
BEFORE INSERT ON test
FOR EACH ROW
DECLARE
BEGIN
if :new.id >= 13 then
/* COMMENTS
If this condition is true, then i need to stop the INSERT statement from executing. How to do this????
*/
raise_application_error(-20001,'operation not allowed');
end if;
END tr_test;
----------------------------------------------------------------------
|
|
|
|