PL SQL MCQ Questions 4

PL SQL MCQ Questions 4

PL-SQL-Objective-Questions-NareshIT

What are internally defined exceptions?

  1. The Oracle ORA errors
  2. Exceptions which are already defined in the STANDARD package
  3. Exceptions defined by a user
  4. Any error that occurs in PL/SQL

Ans : 1


How can a user defined exception be raised?

  1. Using RAISE statement only
  2. Using RAISE statement or RAISE_APPL_ERROR function
  3. Using INVOKE statement or RAISE statement
  4. Using RAISE statement or RAISE_APPLICATION_ERROR procedure

Ans : 4


Which of the following exception is globally available?

  1. Internal, User-defined and Pre-defined exceptions
  2. Pre-defined exceptions only
  3. Internal and pre-defined exceptions
  4. User defined exceptions only

Ans : 2


What happens after an exception handler runs?

  1. The program exits
  2. Control transfers to the last statement of the last block
  3. Control transfers to the next statement of the enclosing block
  4. Control transfers to the last statement of the current block

Ans : 3


Where are exceptions used in PL/SQL?

  1. Only in an anonymous block
  2. Only in the body of a subprogram
  3. Only in a package
  4. Only in an anonymous block and the body of a subprogram

Ans : 4


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


What does an unhandled exception do?

  1. Crashes the database server.
  2. Prints a warning and continues.
  3. Control goes to the invoker without any effect.
  4. Halts the execution of the host program.

Ans : 4


Which of the following function gives the error code of the recently occurred exception?

  1. SQLERRCODE
  2. SQLERROR
  3. ERRCODE
  4. SQLCODE

Ans : 4


What is the maximum number of handlers processed  when an exception occurs?

  1. Only one
  2. All that apply
  3. All referenced
  4. None

Ans : 1


Which of the following is not a valid Oracle PL/SQL exception?

  1. NO_DATA_FOUND ORA01403
  2. TWO_MANY_ROWS ORA01422
  3. DUP_VAL_ON_INDEX ORA00001
  4. OTHERS

Ans : 2


 What command use to see the errors from a recently created stored procedure?

  1. SHOW MISTAKES;
  2. DISPLAY MISTAKES;
  3. DISPLAY ERRORS;
  4. SHOW ERRORS;

Ans : 4


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


How many types of Exceptions in PL/SQL?

  1. 2
  2. 4
  3. 0
  4. 5

Ans : 1


What is Pragma Init Exception in oracle?

  1. PRAGMA EXCEPTION_INIT(exception_name, oracle_error_nb)
  2. PRAGMA_EXCE (Exceptionname);
  3. PRAGMA_INIT_EXCEPTION(exception_name);
  4. None of the above

Ans : 1


Can we define exceptions twice in same block?

  1. Yes
  2. No
  3. Depends upon
  4. None of the above

Ans : 3


Can the PL/SQL block process more than one exception at a time?

  1. Yes
  2. No
  3. Depends upon
  4. None of the above

Ans : 2


Is it possible to have more than one OTHERS clause?

  1. Possible
  2. Not possible to have more than one OTHERS clause in the exception section.
  3. Sometimes possible and not possible
  4. None of the above

Ans : 2


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


What are PL/SQL Cursor Exceptions?

  1. Cursor_Already_Open
  2. Invalid_Cursor
  3. A & B
  4. None of the above

Ans : 3


Which of the following exceptions  procedure fail due to an unanticipated problem ?

  1. no_data_found
  2. others
  3. zero_divide
  4. too_many_rows

Ans : 2


Which of the following keyword allow to associate a user-defined error message ?

  1. Pragma
  2. Others
  3. raise_application_error
  4. Exception

Ans : 3


Which of the following exception received two or more records, you would include ?

  1. too_many_rows
  2. others
  3. zero_divide
  4. no_data_found

Ans : 1


Which statement result of not creating an exception handler for a raised exception?

  1. The program will continue without raising the exception.
  2. There will be a memory leak.
  3. Control will pass to the PL/SQL block caller’s exception handler.
  4. The program will return a %notfound error.

Ans : 3


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Which exception does the others exception handlers not cover?

  1. no_data_found
  2. others
  3. rowtype_mismatch
  4. too_many_rows

Ans : 2


What is the output for   SELECT SAL INTO V_SAL FROM EMP;

  1. All rows selected
  2. First record only printed
  3. Error as “exact fetch returns more than requested number of rows”
  4. None of the above

Ans : 3


What is the output for the  A=10, B=0,C=a/b  Dopl(C); ?

  1. 0
  2. 10
  3. 1
  4. Division by zero error

Ans : 4


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Read More PL/SQL Objective Questions and Answers

Click Here
Click Here
Click Here
PL/SQL Objectives 1
PL/SQL Objectives 2
PL/SQL Objectives 3
PL/SQL Objectives 4
PL/SQL Objectives 5
PL/SQL Objectives 6
PL/SQL Objectives 7
PL/SQL Objectives 8
PL/SQL Objectives 9
PL/SQL Objectives 10
PL/SQL Objectives 11
PL/SQL Objectives 12
PL/SQL Objectives 13
PL/SQL Objectives 14
PL/SQL Objectives 15

Share this post