Question: 1. Trigger: Study the trigger and answer the questions that follow. 1. Consider the INVOICE table structure below: invoice id invoice date. invoice total

1. Trigger: Study the trigger and answer the questions that follow. 1. Consider the INVOICE table structure below: invoice id invoice date. invoice total payment total credit total invoice due date. payment date. CTL REC_user CTL_SEC_level DECLARE V level NUMBER; V_name VARCHAR2 (20); BEGIN END; NUMBER (12), DATE, NUMBER (9, 2), NUMBER (9,2), NUMBER (9, 2), A trigger is created on the INVOICE table: CREATE OR REPLACE TRIGGER Trg_on_Quiz BEFORE INSERT OR UPDATE ON Invoice FOR EACH ROW FROM AUTHORIZED USERS WHERE USERNAME = USER; DATE, DATE, VARCHAR2 (12), NUMBER (1) SELECT USERNAME, SECURITY LEVEL INTO V_name, v_level NEW.CTL REC user : V name; : NEW.CTL SEC level : V_level; EXCEPTION WHEN NO DATA FOUND THEN RAISE APPLICATION_ERROR (-20003, Unauthorized User'); In Oracle/PLSQL, the USER function returns the user_id from the current Oracle session. Write a SQL test statement to fire the trigger (5 points)
Step by Step Solution
3.36 Rating (171 Votes )
There are 3 Steps involved in it
Trigger is a program that is automatically fired by your dat... View full answer
Get step-by-step solutions from verified subject matter experts
