You are on page 1of 5

===============================================================================================================================================================

Oracle 10g - 2011 Examinations


Name: Emp ID: Date:________________
Duration: 60 Min.

- 1. Which table should you query to determine when your procedure was last compiled?

- A. USER PROCEDURES

- B. USER PROCS

- C. USER OBJECTS

- D. USER PLSQL UNITS

- 2. 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

3. Which data Dictionary View gives you the names and source code of all procedures created in your schema

A. USER_SOURCE

B. USER_OBJECTS

C. USER_PROCEDURES

D. USER_TEXT

4. Which timing would you use to create a trigger on a view?

A. BEFORE
B. AFTER
C. INSTEAD OF
D. NO TIMINGS

5. Which of the following sections is mandatory for a PL/SQL block?

1 of 5 Copyright © 2011, Seed Infotech, Noida


===============================================================================================================================================================
a. Exception-handling section

b. Executable section BEGIN ….. END;

c. Declaration section

6.

DECLARE

V_num1 integer: = &v_num1;


V_num2 integer: = &v_num2;
V_result number;

BEGIN

v_result:= v_num1 / v_num2;


DBMS_OUTPUT.PUT_LINE ('v_result: '||v_result);

EXCEPTION
WHEN ZERO_DIVIDE THEN
DBMS_OUTPUT.PUT_LINE ('A number cannot be divided by zero.');
END;

For what possible values of v_num1, v_num2, the code will generate an exception

A. Value of v_num1 = 10 and v_num2 = 0;


B. Value of v_num1 = 100 and value of v_num2 = 100
C. Value of v_num1 = 0 and value of v_num2 = 100
D. None of the above will raise an Exceptions

7.

SET SERVEROUTPUT ON
<< outer_block >>
DECLARE
V_test NUMBER: = 123;
BEGIN
DBMS_OUTPUT.PUT_LINE ('Outer Block, v_test: '||v_test);
<< inner_block >>
DECLARE
v_test NUMBER := 456;
BEGIN
DBMS_OUTPUT.PUT_LINE ('Inner Block, v_test: '||v_test);
DBMS_OUTPUT.PUT_LINE ('Inner Block, outer_block.v_test: '||
outer_block.v_test);
END inner_block;
END outer_block;

What is the result of each output variable?

A. DBMS_OUTPUT.PUT_LINE ('Outer Block, v_test: '||v_test); 123

B. DBMS_OUTPUT.PUT_LINE ('Inner Block, v_test: '||v_test); 456


C. DBMS_OUTPUT.PUT_LINE ('Inner Block, outer_block.v_test: '|| outer_block.v_test); 123

8. Which two programming constructs can be grouped within a package? (Choose two)

A. Cursor

2 of 5 Copyright © 2011, Seed Infotech, Noida


===============================================================================================================================================================
B. Constant

C. Trigger

D. Sequence

E. View

9. Which statements about packages are true? (Choose three)

A. Packages can be nested.

B. You can pass parameters to packages.

C. A package is loaded into memory each once it is invoked.

D. The contents of packages can be shared by many applications.

E. You can achieve information hiding by making package constructs private.

10. Examine this code:

CREATE OR REPLACE PRODECURE add_dept

(p deptname VARCHAR2 DEFAULT ‘placeholder’, p location VARCHAR2 DEFAULT ‘Boston’)

IS

BEGIN

INSERT INTO departments

VALUES (dept id seq.NEXTVAL, p dept name, p_location);

END add_dept;

Which three are valid calls to the add_dept procedure? (Choose three)

A. add_dept;

B. add_dept(p_location=>’Accounting’, p_deptname=>’HRD’);

C. add_dept(p_location=>‘New York’, ‘IT’);

D. add_dept(p location=>’New York’);

11. A package body can be created without the Package Specification?

a. True
b. False

12. Bind variables are created using _______ syntax

a. SQL> VARIABLE <variable name> datatype


b. SQL> <variable name> datatype

3 of 5 Copyright © 2011, Seed Infotech, Noida


===============================================================================================================================================================
c. SQL> <variable name>
d. SQL> Cannot create Bind Variables in Oracle

13.The EXCEPTION_INIT pragma associates a

A. built-in exception with a user-defined error number.

B. user-defined exception with a user-defined error number.

C. user-defined exception with an Oracle error number.

D. User defined handler with Built-in errors number.

14. The exception-handling section in a PL/SQL block is used to

a. _____ handle compilation errors.

b. _____ handle runtime errors.

c. _____ handle both compilation and runtime errors.

15. Which three are true statements about dependent objects? (Choose three)

A. Invalid objects cannot be described.

B. An object with status of invalid cannot be a referenced object.

C. The Oracle server automatically records dependencies among objects.

D. All schema objects have a status that is recorded in the data dictionary.

E. You can view whether an object is valid or invalid in the USER_STATUS data dictionary view.

F. You can view whether an object is valid or invalid in the USER_OBJECTS data dictionary view.

16. Procedure “PROCA” has been created by “USER A” which extract rows from the PRODUCT_INFORMATION
table. Now “USER B” wants to execute the procedure from his schema. “USER A” granted the EXECUTE
Privilege to “USER B”. The DBA has informed “USER
A” that, whenever “USER B “executes the procedure, it should references PRODUCT_INTOMATION table from
“USER B” Schema. With what rights should “USER A” create the “PROCA” procedure.

A. AUTHID CURRENT_USER
B. AUTHID DEFINER
C. AUTHID ALL_USERS
D. Not required !!! By default when the execute privilege is granted the objects from the current
owner is referenced

17. 4. Examine the package body?

Create or replace package Body NIIT_PACK

IS

V_AMOUNT number;

4 of 5 Copyright © 2011, Seed Infotech, Noida


===============================================================================================================================================================
PROCEDURE CREDIT_LIMIT(….);

PROCEDURE GENERATE_SUMMARY(………)

IS

BEGIN

CREDIT_LIMIT(….);

END GENERATE_SUMMARY;

END NIIT_PACK;

Which construct has a forward declaration ?

A v_amount

B credit_limit

C generate_summary

D NIIT_PACK

18. Which SQL statement returns the source code for a table?

a. select dbms_metadata.get_ddl(‘TABLE’, ‘EMP’, ‘SCOTT’) as “ OBJECT CODE” From dual;


b. select dbms_metadata.get_ddl(‘EMP’) as “ OBJECT CODE” From dual;
c. select dbms_metadata(‘EMP’, ‘SCOTT’) as “ OBJECT CODE” From dual;
d. Not possible to view the source code of an object.

19.You were asked to create a sub program that is applicable only to your main application? So, your
manager has informed you to create a local sub program but it should not be registered in your database? Which
section within the PLSQL block would you create the sub program?

A. Declarative Section
B. Begin Section
C. Exception section
D. Create an external program and call it within the PLSQL body

20. Exceptions are raised in

A. Declarative Section
B. Begin And End Section (Executable)
C. Exception Handling Section
D. Executable + Exception handling section

5 of 5 Copyright © 2011, Seed Infotech, Noida

You might also like