Id 1997 00 end to which type must you convert the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: T ON PLAYER BEGIN INSERT INTO PLAYER_BATSTAT (PLAYER_ID, SEASON_YEAR,AT_BATS,HITS) VALUES (:NEW.ID, 1997, 0,0); END; To which type must you convert the trigger to correct the error? A. Row B. Statement C. ORACLE FORM trigger D. Before Answer: A Explanation: The qualifiers :OLD and :NEW can only be used with row triggers. If you attempt to create a statement level trigger using the qualifiers, Oracle generates the following error - The Power of Knowing 1Z0-147 message at compile time: ORA-01912: ROW keyword expected Incorrect Answers B. This triggers is a Statement level trigger by default and that is why it is throwing an error. C. This needs to be a database trigger ROW level Trigger not a Application client-side Trigger. D. The Trigger timing is not relevant to the problem. QUESTION 65: Examine this code: CREATE OR REPLACE PROCEDURE audit_emp (p_id IN emp_empno%TYPE) IS v_id NUMBER; PROCEDURE log_exec IS BEGIN INSERT INTO log_table (user_id, log_delete) VALUES (USER, SYSDATE); END log_exec; v_name VARCHAR2(20); BEGIN DELETE FROM emp WHERE empno = p_id; log_exec; SELECT ename, empno INTO v_name, v_id FROM emp WHERE 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. Answer: C Explanation: Variables must be declared before declaring any subprograms. Incorrect Answers - The Power of Knowing 1Z0-147 A. You may have An?? Statement in a program declaration B. The opposite is true D. You do not use the Execute when calling from a procedure. QUESTION 66: Examine this code: CREATE OR REPLACE PACKAGE metric_converter IS c_height CONSTRAINT NUMBER := 2.54; c_weight CONSTRAINT NUMBER := .454; FUNCTION calc_height (p_height_in_inches NUMBER) RETURN NUMBER; FUNCTION calc_weight (p_weight_in_pounds NUMBER) RETURN NUMBER; END; / CREATE OR REPLACE PACKAGE BODY metric_converter IS FUNCTION calc_height (p_height_in_inches NUMBER) RETURN NUMBER IS BEGIN RETURN p_height_in_inches * c_height; END calc_height; FUNCTION calc_weight (p_weight_in_pounds NUMBER) RETURN NUMBER IS BEGIN RETURN p_weight_in_pounds * c_weight END calc_weight END metric_converter; / CREATE OR REPLACE FUNCTION calc_height (p_he...
View Full Document

This document was uploaded on 03/08/2014.

Ask a homework question - tutors are online