Exammagiccom 22 examine this code create or replace

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: hin the user session WWW.ExamMagic.COM - 22: Examine this code: CREATE OR REPLACE TRIGGER update_emp AFTER UPDATE ON emp BEGIN INSERT INTO audit_table (who, dated) VALUES (USER, SYSDATE); END; You issue an UPDATE command in the EMP table that results in changing 10 rows. How many rows are inserted into the AUDIT_TABLE? A. 1 B. 10 C. None D. A value equal to the number of rows in the EMP table. Answer: A Explanation: www.ExamMagic.com 1Z0-147 Since the Trigger Type is not specified this Trigger defaults to a FOR EACH STATEMENT Trigger. FOR EACH STATEMENT fire once for the triggering event, therefore one record will be inserted into the audit_table. Incorrect Answers B. If this was a FOR EACH ROW Trigger 10 rows would be inserted into the audit_table. C. This trigger will fire & result in 1 record inserted into the audit_table D. If all records were updated and the Trigger was a FOR EACH ROW Level Trigger then this would be the correct Response WWW.ExamMagic.COM - 23: Examine this package: CREATE OR REPLACE PACKAGE BB_PACK IS V_MAX_TEAM_SALARY NUMBER(12,2); PROCEDURE ADD_PLAYER(V_ID IN NUMBER, V_LAST_NAME VARCHAR2, V_SALARY_NUMBER; END BB_PACK; / CREATE OR REPLACE PACKAGE BODY BB_PACK IS PROCEDURE UPD_PLAYER_STAT (V_ID IN NUMBER, V_AB IN NUMBER DEFAULT 4, V_HITS IN NUMBER) IS BEGIN UPDATE PLAYER_BAT_STAT SET AT_BATS = AT_BATS + V_AB, HITS = HITS + V_HITS WHERE PLAYER_ID = V_ID) COMMIT; END UPD_PLAYER_STAT; PROCEDURE ADD_PLAYER (V_ID IN NUMBER, V_LAST_NAME VARCHAR2, V_SALARY NUMBER) IS BEGIN INSERT INTO PLAYER(ID,LAST_NAME,SALARY) VALUES (V_ID, V_LAST_NAME, V_SALARY); UPD_PLAYER_STAT(V_ID,0.0); END ADD_PLAYER; END BB_PACK; Which statement will successfully assign $75,000,000 to the V_MAX_TEAM_SALARY variable from within a stand-alone procedure? www.ExamMagic.com 1Z0-147 A. V_MAX_TEAM_SALARY := 7500000; B. BB_PACK.ADD_PLAYER.V_MAX_TEAM_SALARY := 75000000; C. BB_PACK.V_MAX_TEAM_SALARY := 75000000; D. This variable cannot be assigned a value from outside the package. Answer: C To assign a value for a public variable which is declared in the package header, all what you have to do is do user the following syntax package_name.var_name:=value; WWW.ExamMagic.COM - 24: There is a CUSTOMER table in a schema that has a public synonym CUSTOMER and you are granted all object privileges on it. You have a procedure PROCESS_CUSTOMER that processes customer information that is in the public synonym CUSTOMER table. You have just created a new table called CUSTOMER within your schema. Which statement is true? A. Creating the table has no effect and procedure PROCESS_CUSTOMER still accesses data from public synonym CUSTOMER table. B. If the structure of your CUSTOMER table is the same as the public synonym CUSTOMER table then the procedure PROCESS_CUSTOMER is invalidated and gives compilation errors. C. If the structure of your CUSTOMER table is entirely different from the public synonym CUSTOMER table then the procedure PROCESS_CUSTOMER successfully recompiles and accesses your CUSTOMER table. D. If the structure of your CUSTOMER table is the same as the public synonym CUSTOMER table then the procedure PROCESS_CUSTOMER successfully recompiles when invoked and accesses your CUSTOMER table. Answer: D The procedure will first look in the owner of the procedure schema before looking for the public synonym. Incorrect Answers: A, B, C WWW.ExamMagic.COM - 25: Which two statements about packages are true? (Choose two) www.ExamMagic.com 1Z0-147 A. Both the specification and body are required components of a package. B. The package specification is optional, but the package body is required. C. The package specification is required, but the package body is optional. D. The specification and body of the package are stored together in the database. E. The specification and body of the package are stored separately in the database. Answer: C,E Explanation: Correct Answer C: A Package must have a specification. A Package may also have a body but it is not necessary. A Package without a package body are referred to as a bodiless package. If a package specification contains only variables, constants, types, exceptions, and a call specification, the package body is not required. Correct Answer E: The package specification and body are stored separately in the database. Incorrect Answers: A. A package body is optional B. The package specification is required and the package body is optional D. The package specification and the body are stored in the database as separate objects. WWW.ExamMagic.COM - 26: When creating a function in SQL *Plus, you receive this message: "Warning: Function created with compilation errors." Which command can you issue to see the actual error message? A. SHOW FUNCTION_ERROR B. SHOW USER_ERRORS C. SHOW ERRORS D. SHOW ALL_ERRORS Answer: C Explanation: Correct Answer C: The SQL *Plus command SHOW ERRORS or SHOW ERR Command extracts the error information from the USER_ERRORS view Incorrect Errors A. this is an invalid object B &...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online