Sei sulla pagina 1di 3

Test: Quiz: Using Invoker's Rights and Autonomous Transactions 1.

An autonomous transaction subprogram may be in a the same package as th e calling subprogram or may be in a separate subprogram. True or False? Mark for Review (1) Points True False (*)

Correct 2. Procedure GET_EMPS includes a SELECT ... FROM EMPLOYEES. The procedure was created using Invoker's Rights. Which of the following statements are true? (Choose three.) Mark for Review (1) Points (Choose all correct answers) The user who executes the procedure needs EXECUTE privilege on the proce dure. (*) The creator of the procedure needs SELECT privilege on EMPLOYEES. (*) The user who executes the procedure does not need any privileges. The user who executes the procedure needs SELECT privilege on EMPLOYEES. (*)

Correct 3. Which of the following is the correct syntax to create a procedure usin g Invoker's Rights? Mark for Review (1) Points CREATE PROCEDURE myproc IS AUTHID CURRENT_USER BEGIN ... CREATE PROCEDURE myproc AUTHID CURRENT_USER IS BEGIN ... (*)

CREATE PROCEDURE AUTHID CURRENT_USER myproc IS

BEGIN ... CREATE PROCEDURE myproc IS BEGIN AUTHID CURRENT_USER ...

Correct 4. What will happen when the following subprogram is compiled? PROCEDURE at_proc IS PRAGMA AUTONOMOUS_TRANSACTION; dept_id NUMBER := 90; BEGIN UPDATE ... INSERT ... END at_proc; Mark for Review (1) Points The subprogram will fail because it is missing AUTHID CURRENT_USER befor e IS. The autonomous transaction subprogram will fail because it must include COMMIT or ROLLBACK. (*) The compilation will fail because a semicolon after AUTONOMOUS_TRANSACTI ON is not needed. The program will compile successfully.

Incorrect. Refer to Section 9 Lesson 6. 5. User SALLY's schema contains a NEWEMP table. Sally uses Invoker's right s to create procedure GET_NEWEMP which includes the line: SELECT ... FROM NEWEMP ... ; Sally also grants EXECUTE privilege on the procedure to CURLY, but no other priv ileges. What will happen when Curly executes the procedure? Mark for Review (1) Points The procedure will execute successfully. The procedure will fail because Curly does not have SELECT privilege on NEWEMP.

The procedure will fail because there is no NEWEMP table in Curly's sche ma. (*) The procedure will fail because Curly does not have the EXECUTE ANY PROC EDURE system privilege.

Correct 6. Users SYS (the DBA), TOM, DICK and HARRY each have an EMPLOYEES table i n their schemas. SYS creates a procedure DICK.SEL_EMP using Invoker's Rights whi ch contains the following code: SELECT ... FROM EMPLOYEES ... ; HARRY now executes the procedure. Which employees table will be queried? Mark for Review (1) Points SYS.EMPLOYEES DICK.EMPLOYEES HARRY.EMPLOYEES (*) None of the above

Correct

Potrebbero piacerti anche