Sie sind auf Seite 1von 4

1. The following example shows a valid record data type and variaable. True or F alse?

TYPE DeptRecTyp IS RECORD (deptid NUMBER(4) NOT NULL := 99, dname departments.department_name%TYPE, loc departments.location_id%TYPE, region regions%ROWTYPE ); dept_rec DeptRecTyp; (1) Points True (*) False Incorrect. Refer to Section 10 Lesson 3. 2. What is the correct format to declar e a variable using the following emp_pkg package composite data type? TYPE empre c_type IS TABLE OF employees%ROWTYPE INDEX BY BINARY_INTEGER; (1) Points emp_pkg.emprec_type; emprec_type.emp_pkg; v_emp_table emprec_type.emp_pkg; v_emp_table emp_pkg.emprec_type; (*) None of the above Incorrect. Refer to Section 10 Lesson 3. 3. Which of the following are not allow ed in a bodiless pa ckage? (Choose three) (1) Points (Choose all correct answers ) Subprograms (*) Global variables Private variables (*) User-defined exceptions DML statements (*) Incorrect. Refer to Section 10 Lesson 3. 4. Which of the following statements about a package initi alization block i s true? (1) Points It cannot contain any SQL statements. It is an anonymous block at the end of a package body. (*) It is a procedure in a package that must be invoked before the rest of t he package can be used. It is an anonymous block in the package specification. It is executed automatically every time any global variable in the packa ge is referenced.Correct 5. Functions called from a SQL query or DML statement m ust not end the current transaction, or create or roll back to a savepoint. True or False? (1) Points True (*) False Incorrect. Refer to Section 10 Lesson 3. 6. Package MYPACK contains procedure MYPROC. You can see w hich parameters MYPROC uses by executing: DESCRIBE mypack.myproc. True or False? (1) Points True False (*) Correct 7. Which one of the following can NOT be part of a Package ? (1) Points Procedures Explicit cursors Triggers (*) Functions Global variables Incorrect. Refer to Section 10 Lesson 1. 8. Which of the following are good reas ons for creating an d using Packages? Related procedures, functions and variables can be grouped together as a single unit We can recompile the package body without having to recompile the specification We can create packages without needing any system privileges We can declare INDEX BY tables and use them as parameters (1) Points A and B A, B and C A and C A, B and D (*) A, B, C and D Incorrect. Refer to Section 10 Lesson 1. 9. Which of the following statements ab out packages is NOT true ? (1) Points

Incorrect. Refer to Section 10 Lesson 2. 14. Your schema contains four packages, each having a speci fication and a body. You have also been granted privileges to access three packa ges (and their bodies) in other users' schemas. What will be displayed by the fo llowing query? SELECT COUNT(*) FROM ALL_OBJECTS WHERE object_type LIKE 'PACK%' AND owner <> USER; (1) Points 14 736 (*) 0 Incorrect. Refer to Section 10 Lesson 2. Section 11 15. The UTL_FILE package c an be used to create binary files such as JPEGs as well as text files. True or F alse? (1) Points True False (*)Incorrect. Refer to Section 11 Lesson 2. 16. Which of the following exceptions can be raised ONLY whe n using the UTL_FIL E package? (Choose two). (1) Points (Choose all correct answers) INVALID_PATH (* ) NO_DATA_FOUND VALUE_ERROR READ_ERROR (*) E_MYEXCEP17. Why is it better to use DBMS_OUTPUT only in anonymous b locks, not inside stored subprograms such as procedures? (1) Points Because DBMS_OUTPUT cannot be used inside procedures Because anonymous blocks display messages while the block is executing, while procedures do not display anything until their execution has finished Beca use DBMS_OUTPUT should be used only for testing and debugging PL/SQL code (*) Be cause DBMS_OUTPUT can raise a NO_DATA_FOUND exception if used inside a packaged procedure Correct 18. What will be displayed when the following code is execu ted? BEGINDBMS_OUTPUT.PUT('I do like'); DBMS_OUTPUT.PUT_LINE('to be'); DBMS_OUTPUT.PUT('beside the seaside'); END; (1) Points I do like to be beside the seaside I do like to be beside the seaside I do like to be I do liketo be (*) I do like to be beside the seaside Incorrect. Refer to Section 11 Lesson 2. 19. Package CURSPACK declares a global cursor in the packag e specification. The package contains three public procedures: OPENPROC opens th e cursor; FETCHPROC fetches 5 rows from the cursor's active set; CLOSEPROC close s the cursor. What will happen when a user session executes the following commands in the orde r shown? curspack.openproc; -- line 1 curspack.fetchproc; -- line 2 curspack.fetchproc; -- line 3 curspack.openproc; -- line 4 curspack.fetchproc; -- line 5 curspack.closeproc; -- line 6 (1) Points The first 15 rows will be fetched. The first 10 rows will be fetched, then the first 5 rows will be fetched again. The first 5 rows will be fetched three times. An error will occur at line 2. An error will occur at line 4. (*) Incorrect. Refer to Section 11 Lesson 1. 20. Package MULTIPACK declares the foll

owing global variabl e: g_myvar NUMBER; User DICK executes the following: multip ack.g_myvar := 45; User HAZEL now connects to the database. Both users immediately execute: BEGINDBMS_OUTPUT.PUT_LINE(multipack.g_myvar); END; What values will Dick and Hazel see? (1) Points A PL/SQL subprogram that always returns exactly one value. A subprogram that is invoked explicitly by the calling application. A PL/SQL subprogram that inserts rows into a logging table. Correct 44. What is wrong with the following code? CREATE TRIGGER dept_trigg BEFORE UPDATE OF department_name ON departments BEGINDBMS_OUTPUT.PUT_LINE(:NEW.department_name); END; (1) Points You cannot use :NEW in a BEFORE trigger, only in an AFTER trigger. You cannot use :NEW or :OLD in a statement trigger. (*) You cannot use DBMS_OUTPUT.PUT_LINE inside a trigger. The second line should be: BEFORE UPDATE ON departments.department_name Incorrect. Refer to Section 13 Less on 2. 45. What is wrong with the following code? CREATE OR REPLACE TRIGGER loc_trigg BEFORE DELETE ON locations BEGINRAISE_APPLICATION_ERROR(-20201,'Invalid delete'); ROLLBACK; END; (1) Points The last line should be: END loc_trigg; You cannot use RAISE_APPLICATION_ERROR inside a trigger. The second line should be: BEFORE DELETE OF locations You cannot use ROLLBACK inside a trigger. (*) Nothing is wrong, this trigger wil l compile and execute successfully. Incorrect. Refer to Section 13 Lesson 2. 46. A DML statement trigger fires only once for each trigge ring DML statement, whi le a row trigger fires once for each row processed by the triggering statement. True or False? (1) Points True (*) False Incorrect. Refer to Section 13 Lesson 2. 47. Examine the following code: CREATE TRIGGER emp_trigg -- Line A BEGININSERT INTO log_table VALUES (USER, SYSDATE); END; Which of the following can NOT be coded at Line A? (1) Points BEFORE UPDATE ON employees AFTER INSERT OR DELETE ON employees AFTER SELECT ON employees (*) BEFORE DELETE ON employees AFTER UPDATE OF last_name ON employees Correct 48. You need to disable all triggers that are associated wi th DML state ments on the DEPARTMENTS table. Which of the following commands shou ld you use? (1) Points ALTER TABLE departments DISABLE ALL TRIGGERS; (*) ALTER TRIGGER DISABLE ALL ON departments; ALTER TABLE departments DISABLE TRIGGERS; DISABLE ALL TRIGGERS ON departments; ALTER TABLE departments DROP ALL TRIGGERS; Incorrect. Refer to Section 13 Lesson 5. 49. User AYSEGUL successfully creates t he following trigger :CREATE TRIGGER loc_trigg BEFORE UPDATE ON aysegul.location s BEGIN....

AYSEGUL now tries to drop the LOCATIONS table. What happens? (1) Points An error message is displayed because you cannot drop a table that is as sociate d with a trigger. The table is dropped and the trigger is disabled. The trigger is dropped but the table is not dropped. Both the table and the trigger are dropped. (*) None of the above. Incorrect. Refer to Section 13 Lesson 5. 50. Which of the following will remove a trigger in your sc hema named EMP_TRIGG from the database? (1) Points DROP emp _trigg TRIGGER; ALTER TRIGGER emp_trigg DISABLE; DROP TRIGGER emp_trigg; (*) REMOVE TRIGGER emp_trigg; None of the above Incorrect. Refer to Section 13 Lesson 5.

Das könnte Ihnen auch gefallen