問題詳情

QUESTION 55Examine this code:CREATE OR REPLACE PROCEDURE audit_emp(p_id IN emp_empno%TYPE)ISv_id NUMBER;PROCEDURE log_execISBEGININSERT INTO log_table (user_id, log_delete)VALUES (USER, SYSDATE);END log_exec;v_name VARCHAR2(20);BEGINDELETE FROM empWHERE empno = p_id;log_exec;SELECT ename, empnoINTO v_name, v_idFROM empWHERE empno = p_id;END audit_emp;Why does this code cause an error when compiled?
(A)An insert statement is not allowed in a subprogram declaration.
(B)Procedure LOG_EXEC should be declared before any identifiers.
(C)Variable v_name should be declared before declaring the LOG_EXEC procedure.
(D)The LOG_EXEC procedure should be invoked as EXECUTE log_exec with the AUDIT_EMP procedure.

參考答案

答案:C
難度:非常困難0
統計:A(0),B(0),C(0),D(0),E(0)