Answer c question 48 examine the trigger create a

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: of the use who successfully modified tables and in audit table. Answer: C QUESTION 48: Examine the trigger Create a replace trigger cascade_updates After update (Deptno) on Dept For each row BEGIN UPDATE EMP SET emp_deptno=: new. Deptno WHERE emp.Deptno=: old.Deptno; END When this trigger will fire successfully? A. Only when the dept no in the emp table holds a NULL value. B. Irrespective of any referential integrity constraints between two tables. - The Power of Knowing 1Z0-101 C. When there is no referential integrity between the dept number columns of the emp and the dept tables within their table definitions. D. Only when there is referential integrity constraint between the emp no columns of the emp and dept tables within their table definitions. Answer: C QUESTION 49: Examine this code: CREATE OR REPLACE PROCEUDRE AUDIT_EMP; (P_ID IN EMP. EMPNO%TYPE) IS V_ID NUMBER; PROCEDURE LOG_EXEC IS BEGIN INSERT INTO LOG_TABLE (USER_ID,LOG_DATE) VALUES (USERS,SYSDATE); END LOG_EXEC V_NAME VARCHAR2(20) BEGIN DELECT 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 and error when compiled? A. An insert statement is not allowed in a sub program declaration. B. The LOG_exec procedure should be declared before any identifiers. C. The V_NAME variable should be declared before declaring the LOG_EXEC procedure. D. The LOG_EXEC procedure should be invoked as execute log_exec with in the AUDIT_EMP procedure. Answer: C QUESTION 50: When creating a function in which section will you typically find a return key word? - The Power of Knowing 1Z0-101 A. Header Only B. Declarative C. Executable and header D. Executable and exception handling Answer: C QUESTION 51: Examine the trigger CREATE OR REPLACE TRIGGER Emp_count AFTER DELETE ON Emp_tab FOR EACH ROW DECLARE N INTEGER; BEGIN SELECT COUNT(*) INTO n FROM Emp tab; DBMS_OUT. PUT_LINE( 'there are now'||n|| 'employees'); END; The trigger results in error after this SQL statement is entered Delete from emp_tab where emp no is equal to 7499; How do you correct the error? 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 statement level trigger by removing for each row. Answer: D QUESTION 52: CREATE OR REPLACE PACKAGE COMPILE_THIS IS G_VALUE VARCHAR2(100); PROCEDURE A; PROCEDURE B; END COMPILE_THIS; / CREATE OR REPLACE PACKAGE BODY COMPILE_THIS IS PROCEDURE A IS - The Power of Knowing 1Z0-101 BEGIN G_VALUE := ('HELLO WORLD'); END A; PROCEDURE B IS BEGIN C; DBMS_OUTPUT. PUT_LINE ('PROCEDURE B CALLING C'); END B; PROCEDURE C IS BEGIN B; DBMS_OUTPUT. PUT_LINE ('PROCEDURE C CALLING B'); END; END COMILE_THIS; / Procedure C is a local construct to the package. What happens when this package is compiled? A. It produces the output Procedure B calling C B. It produces the output Procedure C calling B C. It produces a compilation error because procedure c requires a forward declaration. D. It produces a compilation error because procedure b requires a forward declaration. E. It produces a compilation error because identified g_value is not declared in procedure A Answer: C QUESTION 53: When creating procedures, arguments should be placed before which keyword? A. IS B. BEGIN C. DECLARE D. PROCEDURE Answer: A QUESTION 54: You have row level before update trigger on EMP table. The trigger contains a select statement on the EMP table to ensure that the new salary value falls within a minimum and maximum salary for a given job title. What - The Power of Knowing 1Z0-101 happens when you try to update the salary value in the EMP table? A. Trigger fire successfully. B. Trigger fails because it needs to be a row level after update trigger. C. A trigger fails because a select statement on the table being updated is not allowed. D. The trigger fails because you cannot use minimum and maximum functions in a before update trigger table. Answer: C QUESTION 55: The ADD_PLAYER, UPD_PLAYER_STAT and UPD_PITCHER_STAT procedures are grouped together in a package. A variable must be shared among only these procedures. Where should you declare this variable? A. In the package body. B. In the data base triggers. C. In the package specification. D. In the procedures declare section using the exact name in each. Answer: A QUESTION 56: You have created a stored procedure DELETE_TEMP_TABLE that uses a dynamic SQL To remove a table in your scheme you have granted the execute privilege to a user A on this procedure. When user A executes the DELETE_TEMP_TABLE procedure...
View Full Document

This document was uploaded on 03/08/2014.

Ask a homework question - tutors are online