You are on page 1of 4

Test: Quiz: Managing Procedures and Functions 1.

The database administrator has granted the DROP ANY PROCEDURE privilege to user KIM. This allows Kim to remove other users' procedures and functions fr om the database. How would Kim now drop function GET_EMP, which is owned by user MEHMET? Mark for Review (1) Points DROP FUNCTION get_emp FROM mehmet DROP FUNCTION mehmet.get_emp (*) DROP PROCEDURE mehmet.get_emp DROP PROGRAM mehmet.get_emp None of the above

Correct 2. You need to remove procedure BADPROC from your schema. What is the corr ect syntax to do this? Mark for Review (1) Points DELETE PROCEDURE badproc; DROP PROGRAM badproc; ALTER PROCEDURE badproc DISABLE; DROP PROCEDURE badproc; (*)

Correct 3. Procedure ins_emp accepts an employee_id as an IN parameter and attempt s to insert a row with that employee_id into the EMPLOYEES table. Ins_emp does n ot contain an exception section. A second procedure is created as follows: CREATE OR REPLACE PROCEDURE call_ins_emp IS BEGIN ins_emp(99); -- this employee does not exist ins_emp(100); -- this employee already exists ins_emp(999); -- this employee does not exist EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('An exception occurred'); END;

When call_ins_emp is executed, which rows will be inserted into the EMPLOYEES ta ble? Mark for Review (1) Points 99 only (*) 99 and 999 All three rows will be inserted 999 only No rows will be inserted

Correct 4. proc_a has been created as follows: CREATE OR REPLACE PROCEDURE proc_a IS v_last_name employees.last_name%TYPE; BEGIN SELECT last_name INTO v_last_name FROM employees WHERE employee_id = 999; /* This SELECT will raise an exception because employee_id 999 does not exis t */ DBMS_OUTPUT.PUT_LINE('This SELECT failed'); END; proc_b is now created as follows: CREATE OR REPLACE PROCEDURE proc_b IS BEGIN proc_a; DBMS_OUTPUT.PUT_LINE('proc_a was invoked'); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('An exception occurred'); END; What will be displayed when proc_b is executed? Mark for Review (1) Points An exception occurred (*)

This SELECT failed proc_a was invoked

An exception occurred This SELECT failed This SELECT failed proc_a was invoked Nothing will be displayed

Correct 5. Which view would you query to see the detailed code of a procedure? Mark for Review (1) Points user_source (*) user_procedures user_objects user_dependencies user_errors

Correct 6. Which dictionary view will list all the PL/SQL subprograms in your sche ma? Mark for Review (1) Points user_source user_procedures user_objects (*) user_dependencies user_subprograms

Correct

You might also like