Question: Examine the following trigger:
CREATE OR REPLACE TRIGGER Emp_count
AFTER DELETE ON Employee
FOR EACH ROW
DECLARE
n INTEGER;
BEGIN
SELECT COUNT(*) INTO n FROM employee;
DMBS_OUTPUT.PUT_LINE( 'There are now' || n || 'employees');
END;
This trigger results in an error after this SQL statement is entered: DELETE FROM Employee WHERE Empno = 7499;
How should the error be corrected?
A
Change the trigger type to a BEFORE DELETE
B
Take out the COUNT function because it is not allowed in a trigger
C
Remove the DBMS_OUTPUT statement because it is not allowed in a trigger
D
Change the trigger to a statement-level trigger by removing FOR EACH ROW
Question: Examine the following code:
CREATE OR REPLACE FUNCTION gen_email (first_name VARCHAR2, last_name VARCHAR2,
id NUMBER)
RETURN VARCHAR2 IS
email_name VARCHAR2(19);
BEGIN
email_name := SUBSTR(first_name, 1, 1) ||
SUBSTR(last_name, 1, 7) ||.@Oracle.com .;
UPDATE employees SET email = email_name
WHERE employee_id = id;
RETURN email_name;
END;
Which of the following statements removes the function?