Created
December 19, 2013 19:48
-
-
Save bendem/8045081 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ---------------------------------------------- | |
-- @Author: bendem | |
-- @Date: 2013-12-17 12:10:38 | |
-- @Last Modified by: bendem | |
-- @Last Modified time: 2013-12-19 12:07:26 | |
-- ---------------------------------------------- | |
CREATE OR REPLACE TRIGGER BeforeRow | |
BEFORE UPDATE ON TestProc | |
FOR EACH ROW | |
DECLARE | |
BeginByO EXCEPTION; | |
roted TestProc.b%type; | |
BEGIN | |
IF INSTR(LOWER(:new.b), 'o') != 0 THEN | |
raise BeginByO; | |
END IF; | |
IF INSTR(LOWER(:old.b), 'fix') != 0 THEN | |
rot(:old.b, roted, 3); | |
:new.b := REPLACE(:new.b, :old.b, roted); | |
dbms_output.put_line('Mon tuple initial est ' || :old.b); | |
dbms_output.put_line('Mon tuple modifie est ' || :new.b); | |
END IF; | |
EXCEPTION | |
WHEN BeginByO THEN | |
raise_application_error(-20001, 'Erreur'); | |
WHEN OTHERS THEN | |
dbms_output.put_line('Hey!'); | |
END; | |
/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment