CONSIDER THE INVOICE TABLE BELOW: invoice id NUMBER (12), invoice date DATE, Invoice total NUMBER (9, 2), payzent_total NUBER (9, 2), credit total NUMBER (9, 2), invoice due date DATE, payrent date DATE, CIL REC user VARCHAR2 (12), CTL SEC level NUMBER (1) Consider the INVOICE table structure below: A trigger is created on the INVOICE table: CREATE OR REPLACE TRIGGER rg_On_Quiz before insert or update on Invoice FOR EACH ROW DECLARE V_level Number; V_name VARCHAR (20); Begin SELECT USERNAME, SECURITY_LEVEL INTO V_name, V_level FROM AUTHORIZED_USERS WHERE USERNAME = USER; :NEW.CTL_REC_user := V_name; :NEW.CTL_REC_user := V_level; EXCEPTION WHEN NO_DATA_FOUND THEN RAISE_APPLICATION_ERROR (-2003, 'UNAUTHORIZED USER'); END; In Oracle/PLSQL, the USER function returns the user_id from the current Oracle session. a.) Explain what this triger does in a layman's language. b.) Write a SQL test statement to fire the trigger. c.) How does this trigger provide or does not provide protection in the following two aspects? Confidentiality and Integrity
CONSIDER THE INVOICE TABLE BELOW:
invoice id NUMBER (12),
invoice date DATE,
Invoice total NUMBER (9, 2),
payzent_total NUBER (9, 2),
credit total NUMBER (9, 2),
invoice due date DATE,
payrent date DATE,
CIL REC user VARCHAR2 (12),
CTL SEC level NUMBER (1)
Consider the INVOICE table structure below:
A trigger is created on the INVOICE table:
CREATE OR REPLACE TRIGGER rg_On_Quiz
before insert or update on Invoice
FOR EACH ROW
DECLARE
V_level Number;
V_name VARCHAR (20);
Begin
SELECT USERNAME, SECURITY_LEVEL
INTO V_name, V_level
FROM AUTHORIZED_USERS
WHERE USERNAME = USER;
:NEW.CTL_REC_user := V_name;
:NEW.CTL_REC_user := V_level;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR (-2003, 'UNAUTHORIZED USER');
END;
In Oracle/PLSQL, the USER function returns the user_id from the current Oracle session.
a.) Explain what this triger does in a layman's language.
b.) Write a SQL test statement to fire the trigger.
c.) How does this trigger provide or does not provide protection in the following two aspects? Confidentiality and Integrity
The question is to answer the given queries related to Oracle.
Step by step
Solved in 2 steps