Which statement removes the function?

Examine this code:
CREATE OR REPLACE FUNCTION gen_email_name
(p_first_name VARCHAR2, p_last_name VARCHAR2, p_id NUMBER)
RETURN VARCHAR2
IS
v_email_name VARCHAR2(19=;
BEGIN
v_email_name := SUBSTR(p_first_name, 1, 1) ||
SUBSTR(p_last_name, 1, 7) ||
‘@Oracle.com’;
UPDATE employees
SET email = v_email_name
WHERE employee_id = p_id;
RETURN v_email_name;
END;
Which statement removes the function?

Examine this code:
CREATE OR REPLACE FUNCTION gen_email_name
(p_first_name VARCHAR2, p_last_name VARCHAR2, p_id NUMBER)
RETURN VARCHAR2
IS
v_email_name VARCHAR2(19=;
BEGIN
v_email_name := SUBSTR(p_first_name, 1, 1) ||
SUBSTR(p_last_name, 1, 7) ||
‘@Oracle.com’;
UPDATE employees
SET email = v_email_name
WHERE employee_id = p_id;
RETURN v_email_name;
END;
Which statement removes the function?

A.
DROP FUNCTION gen_email_name;

B.
REMOVE gen_email_name;

C.
DELETE gen_email_name;

D.
TRUNCATE gen_email_name;

E.
ALTER FUNCTION gen_email_name REMOVE;

Explanation:
Stored functions can be permanently removed from the database by dropping them. You use the
following statement for dropping a stand-alone stored function:
DROP FUNCTION <function name>;
Answers B, C, D & E are incorrect & will generate errors



Leave a Reply 0

Your email address will not be published. Required fields are marked *