Exammagiccom 1z0 147 delete from emp where empno pid

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: er_id, log_delete) VALUES (USER, SYSDATE); END log_exec; v_name VARCHAR2(20); BEGIN www.ExamMagic.com 1Z0-147 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 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. WWW.ExamMagic.COM - 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 www.ExamMagic.com 1Z0-147 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_height_in_inches NUMBER) RETURN NUMBER IS BEGIN RETURN p_height_in_inches * metric_converter.c_height; END calc_height; / Which statement is true? A. If you remove the package specification, then the package body and the stand alone stored function CALC_HEIGHT are removed. B. If you remove the package body, then the package specification and the stand alone stored function CALC_HEIGHT are removed. C. If you remove the package specification, then the package body is removed. D. If you remove the package body, then the package specification is removed. E. If you remove the stand alone stored function CALC_HEIGHT, then the METRIC_CONVERTER package body and the package specification are removed. F. The stand alone function CALC_HEIGHT cannot be created because its name is used in a packaged function. Answer: C Explanation: If you remove the package specification, the package body will be removed. To remove the package specification and the package body from the database, you use the following syntax: DROP PACKAGE ; The DROP PACKAGE statement removes both the package specification and the package body from the database. Incorrect Answers A. If you remove the package specification the package body will also be deleted. To delete a stand-alone procedure you must issue a DROP PROCEDURE ProcedureName www.ExamMagic.com 1Z0-147 command. B. If you remove the package body only the package body is removed by the DROP PACKAGE BODY command. To delete the package specification and the package body you issue a DROP PACAKGE Command. Droppig a Package has no impact on stand-alone procedures. D. The DROP PACKAGE BODY statement removes only the package body. The package specification remains intact in the database. The status of the package specification remains VALID even if the corresponding package body is dropped from the database. To remove only the package body from the database, you use the following syntax: DROP PACKAGE BODY ; E. Dropping a stand-alone procedure or function does not drop any package objects. F. You may have stand-alone functions & procedures with the same name as a Packaged program units. They are stored separately and they are qualified using the Package Name when calling the Package Procedure or function. WWW.ExamMagic.COM - 67: What is a condition predicate in a DML trigger? A. A conditional predicate allows you to specify a WHEN-LOGGING-ON condition in the trigger body. B. A conditional predicate means you use the NEW and OLD qualifiers in the trigger body as a condition. C. A conditional predicate allows you to combine several DBM triggering events into one in the trigger body. D. A conditional predicate allows you to specify a SHUTDOWN or STARTUP condition in the trigger body. Answer: C Explanation: A trigger can fire for all three DML statements, INSERT, UPDATE, and DELETE. You can create a single trigger that fires whenever any of the three events occur. You can determine which one of the three DML statements caused the trigger to fire. There three conditional predicates are INSERTING, UPDATING, and DELETING. All three predicates are BOOLEAN values indicating a TRUE or FALSE value in response to the triggering event that fired the trigger. You can check these BOOLEAN values to control processing within the trigger body. Incorrect Answers A. This does not exist in Oracle www.ExamMagic.com 1Z0-147 B. These have nothing to do with conditional predicates. The :OLD & :NEW qualifiers are used in ROW level Triggers to reference the incoming data...
View Full Document

Ask a homework question - tutors are online