Created
January 17, 2011 14:03
-
-
Save jamesantrobus/782868 to your computer and use it in GitHub Desktop.
Part of the Oracle Academy training material provided to Universities
This file contains hidden or 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
| --Part of the Oracle Academy training material provided to Universities | |
| create or replace | |
| TRIGGER secure_employees | |
| BEFORE INSERT OR UPDATE OR DELETE ON employees | |
| BEGIN | |
| secure_dml; | |
| END secure_employees; | |
| create or replace | |
| PROCEDURE secure_dml | |
| IS | |
| BEGIN | |
| IF TO_CHAR (SYSDATE, 'HH24:MI') NOT BETWEEN '08:00' AND '18:00' | |
| OR TO_CHAR (SYSDATE, 'DY') IN ('SAT', 'SUN') THEN | |
| RAISE_APPLICATION_ERROR (-20205, | |
| 'You may only make changes during normal office hours'); | |
| END IF; | |
| END secure_dml; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment