This blog post on Oracle 11g PL/SQL contains Cursors and Exception Handling Multiple Choice Questions. These Practice Questions on Cursors and Exception Handling in PLSQL Blocks will help entry level Database programmers to answer most common Oracle 11g PL/SQL Interview Questions.


Oracle 11g PL/SQL Cursors and Exception Handling Essay Questions

1. What is the difference between an explicit and an implicit cursor?
ANS: Implicit cursors are declared automatically for all DML and SELECT statements issued within a PL/SQL block. Explicit cursors on the other hand, are declared and manipulated in the PL/SQL block code for handling a set of rows returned by a SELECT statement.

2. Discuss the meaning of the term exception handler.
ANS: An exception handler is a mechanism to trap an error that occurs in processing. Its code handles the error in a user-friendly manner and allows the application to continue.The section of a block begins with the EXCEPTION keyword and follows the BEGIN section.

3. What is the difference between a predefined exception and a user-defined exception?
ANS: Oracle supplies a set of predefined exceptions or names associated with common Oracle errors. These predefined exceptions are declared in the STANDARD package, which makes them globally available on the system. A user-defined exception is one that a developer explicitly raises in the block to enforce a business rule.

Also Read : Oracle 11g PL/SQL Basic Block Structures Questions for Interview


Oracle 11g PL/SQL Cursors and Exception Handling Multiple Choice Question

1. A(n) ____ represents a work area or section of memory in which an SQL statement is being processed in the Oracle server.

a. collection

b. variable

c. variable

d. nested table

ANS: C


2. ____ are declared automatically for DML and SELECT statements issued within a PL/SQL block.

a. Implicit cursors

b. Index-by Tables

c. Assignment statements

d. Collections

ANS: A

Also Read : Oracle 11g PL/SQL Practice Questions for Interview


3. ____ are declared and manipulated in the PL/SQL block code for handling a set of rows returned by a SELECT statement.

a. Implicit cursors

b. Implicit cursors

c. Implicit cursors

d. Implicit cursors

ANS: D


4. The ____ action used with an explicit cursor creates a named cursor identified by a SELECT statement.

a. OPEN

b. DECLARE

c. FETCH

d. CLOSE

ANS: B

lso Read : Oracle 11g PL/SQL Handling Data in PLSQL Blocks Practice Questions


5. The ____ action used in an explicit cursor processes the query and creates an active set of rows available in the cursor

a. DECLARE

b. OPEN

c. FETCH

d. CLOSE

ANS: B


6. The ____ action used with an explicit cursor clears the active set of rows and frees the memory area used for the cursor.

a. CLOSE

b. OPEN

c. DECLARE

d. FETCH

ANS: A


7. What can be used to simplify processing each row of a set retrieved from a database?

a. CURSOR

b. CURSOR For LOOP

c. LOOP

d. CURSOR Attribute

ANS: B


8. ____ are values passed into the cursor when opened and used in the SELECT statement of the cursor to determine what value it will contain.

a. Collections

b. Subqueries

c. Parameters

d. Variables

ANS: C


9. A(n) ____ is a mechanism to trap an error that occurs in processing.

a. EXCEPTION

b. UPDATE

c. Exception handler

d. GOTO

ANS: C


10. The ____ section of a PL/SQL block addresses two situations: either an Oracle error is raised or a user-defined error is raised.

a. DECLARE

b. BEGIN

c. EXCEPTION

d. UPDATE

ANS: C


11. Oracle supplies a set of ____ or names associated with common Oracle errors.

a. predefined exceptions

b. looping constructs

c. exception handlers

d. Searched CASES

ANS: A


12. ____ refers to a SELECT statement in a PL/SQL block that retrieves no rows.

a. TOO_MANY_ROWS

b. NO_DATA_FOUND

c. ZERO_DIVIDE

d. DUP_VAL_ON_INDEX

ANS: B


13. ____ refers to a SELECT statement in a PL/SQL block that retrieves more than one row.

a. NO_DATA_FOUND

b. ZERO_DIVIDE

c. CASE_NOT_FOUND

d. TOO_MANY_ROWS

ANS: D


14. ____ refers to a condition where there is no WHEN clause in the CASE statement.

a. CASE_NOT_FOUND

b. ZERO_DIVIDE

c. DUP_VAL_ON_INDEX

d. NO_DATA_FOUND

ANS: A


15. ____ refers to an attempted violation of a unique or primary key column constraint.

a. NO_DATA_FOUND

b. TOO_MANY_ROWS

c. DUP_VAL_ON_INDEX

d. CASE_NOT_FOUND

ANS: C


16. ____ has the possibility of raising the NO_DATA_FOUND or TOO_MANY_ROWS exception.

a. DECLARE

b. SELECT

c. CASE

d. LOOP

ANS: B


17. ____ is required in a PRAGMA EXCEPTION_INIT statement.

a. LOOP

b. Exception name

c. Predefined error

d. INIT code

ANS: B


18. A(n) ____ is one that a developer explicitly raises in the block to enforce a business rule.

a. predefined exception

b. exception

c. user-defined exception

d. error

ANS: C


19. Which of the following statements is correct?

a. An exception that has been declared must be referred to in the RAISE statement, or a PL/SQL error will occur.

b. An exception that has not been declared must be referred to in the RAISE statement, or a PL/SQL error will occur.

c. An exception that has been declared must not be referred to in the RAISE statement, or a PL/SQL error will occur.

d. An exception that has been declared must be referred to in the SELECT statement, or a PL/SQL error will occur.

ANS: A


20. ____ is used to trap errors not specifically addressed in one of the exception handlers.

a. WHERE

b. EXIT WHEN

c. WHEN OTHERS

d. EXCEPTION

ANS: C


21. The ____ handler should always be the last handler listed in the EXCEPTION section of a block.

a. TOO_MANY_ROWS

b. NO_DATA_FOUND

c. EXIT WHEN

d. WHEN OTHERS

ANS: D


22. ____ returns the Oracle error message.

a. EXIT WHEN

b. SQLCODE

c. SQLERR

d. SQLERRM

ANS: D


23. Which of the following statements is correct?

a. The value of the SQLCODE can be used directly in an SQL statement.

b. The value of the SQLCODE is assigned to a variable.

c. The value of the SQLCODE can not be assigned to a variable.

d. The value of the SQLERRM can be used directly in an SQL statement.

ANS: B


24. The ____ is an Oracle built-in procedure that allows developers to associate their own error number and message to an error.

a. SQLCODE

b. SQLERRM

c. RAISE_APPLICATION_ERROR

d. WHEN OTHERS

ANS: C


25. The ____ option groups rows of queries or DML statements for processing.

a. FORALL

b. COLLECT BULK

c. BULK COLLECT

d. LIMIT

ANS: C


26. The ____ option specifies the number of rows to process as a group.

a. FORALL

b. NUMROWS

c. BULK COLLECT

d. LIMIT

ANS: D


Also Read : Oracle 11g PL/SQL Basic Block Structures Completion Questions

Also Read : Introduction to Oracle 11g PL/SQL Practice Question and Answers

http://techhowdy.com/wp-content/uploads/2017/10/Oracle-11g-PLSQL-7.pnghttp://techhowdy.com/wp-content/uploads/2017/10/Oracle-11g-PLSQL-7-150x150.pngDemonDatabase ProgrammingThis blog post on Oracle 11g PL/SQL contains Cursors and Exception Handling Multiple Choice Questions. These Practice Questions on Cursors and Exception Handling in PLSQL Blocks will help entry level Database programmers to answer most common Oracle 11g PL/SQL Interview Questions.Oracle 11g PL/SQL Cursors and Exception Handling Essay Questions 1. What is the...Latest technology news