Question: (a) Write an Oracle-compatible SQL statement to create a trigger that prevents an UPDATE of the payment_date column if the payment_date value is earlier than
(a) Write an Oracle-compatible SQL statement to create a trigger that prevents an UPDATE of the payment_date column if the payment_date value is earlier than the invoice_date value. The trigger should raise an appropriate error when the criteria is violated. (b) Write an Oracle-compatible SQL command that causes the trigger to fire.
INVOICES Columns Data Constraints Grants IStatistics Triggers Flashback Dependencies Details Partitions Indexes ISQL ???? Actions.. NULLABLE DATA DEFAULT ) COLUMN-ID ? COMMENTS DATA TYPE NUMBER NUMBER COLUMN_NAME 1 INVOICE ID 2 VENDOR ID 3 INVOICE_NUMBER VARCHAR2(50 BYTE) No 4 INVOICE DATE 5 INVOICE TOTAL NUMBER(9,2) 6 PAYMENT TOTAL NUMBER(9,2) 7 CREDIT TOTAL 8 TERMS ID 9 INVOICE DUE DATE DATE 10 PAYMENT DATE DATE 1 (null) 2 (nul) 3 (null) 4 (null) 5 (null) 6 (null) 7 (null) 8 (null) 9 (nul) 10 (null) (null) (null) (null) (null) (null) 0 No No 0 Yes Yes DATE NUMBER(9,2) NUMBER 0 (null) (null) 0 No Yes (null)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
