Write a trigger that is fired before the DML statement’s execution on the EMPLOYEE table. The trigger checks the day based on SYSDATE. If the day is Sunday, the trigger does not allow the DML statement’s execution and raises an exception. Write the appropriate message in the exception-handling section.

What will be an ideal response?


```
SQL> CREATE OR REPLACE TRIGGER sunday_trigger
2 BEFORE INSERT OR DELETE OR UPDATE ON EMPLOYEE
3 FOR EACH ROW
4 DECLARE
5 sunday_ex EXCEPTION;
6 BEGIN
7 IF TO_CHAR(SYSDATE, 'DAY') = 'SUNDAY' THEN
8 RAISE sunday_ex;
9 END IF;
10 EXCEPTION
11 WHEN sunday_ex THEN
12 DBMS_OUTPUT.PUT_LINE('No DML allowed on Sunday');
13 END;
14 /

Trigger created.
```

Computer Science & Information Technology

You might also like to view...

What are the disadvantages of converting a color image to black-and-white by converting it from RGB to Grayscale mode?

What will be an ideal response?

Computer Science & Information Technology

In Excel, you can track and manage financial and numerical data, and you can also create simple ________, which are collections of data related to a particular topic or purpose

A) functions B) databases C) arrays D) tables

Computer Science & Information Technology

If the destination and ____folders are on the same media, you can move a file by dragging it.

A. graph B. source C. table D. placeholder

Computer Science & Information Technology

VMware Fusion is a popular virtual machine manager for which operating system?

A. Solaris B. Linux C. Mac OS X D. Windows 7

Computer Science & Information Technology