PL SQL MCQ Questions 4
What are internally defined exceptions?
- The Oracle ORA errors
- Exceptions which are already defined in the STANDARD package
- Exceptions defined by a user
- Any error that occurs in PL/SQL
Ans : 1
How can a user defined exception be raised?
- Using RAISE statement only
- Using RAISE statement or RAISE_APPL_ERROR function
- Using INVOKE statement or RAISE statement
- Using RAISE statement or RAISE_APPLICATION_ERROR procedure
Ans : 4
Which of the following exception is globally available?
- Internal, User-defined and Pre-defined exceptions
- Pre-defined exceptions only
- Internal and pre-defined exceptions
- User defined exceptions only
Ans : 2
What happens after an exception handler runs?
- The program exits
- Control transfers to the last statement of the last block
- Control transfers to the next statement of the enclosing block
- Control transfers to the last statement of the current block
Ans : 3
Where are exceptions used in PL/SQL?
- Only in an anonymous block
- Only in the body of a subprogram
- Only in a package
- 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?
- Crashes the database server.
- Prints a warning and continues.
- Control goes to the invoker without any effect.
- Halts the execution of the host program.
Ans : 4
Which of the following function gives the error code of the recently occurred exception?
- SQLERRCODE
- SQLERROR
- ERRCODE
- SQLCODE
Ans : 4
What is the maximum number of handlers processed when an exception occurs?
- Only one
- All that apply
- All referenced
- None
Ans : 1
Which of the following is not a valid Oracle PL/SQL exception?
- NO_DATA_FOUND ORA01403
- TWO_MANY_ROWS ORA01422
- DUP_VAL_ON_INDEX ORA00001
- OTHERS
Ans : 2
What command use to see the errors from a recently created stored procedure?
- SHOW MISTAKES;
- DISPLAY MISTAKES;
- DISPLAY ERRORS;
- 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?
- 2
- 4
- 0
- 5
Ans : 1
What is Pragma Init Exception in oracle?
- PRAGMA EXCEPTION_INIT(exception_name, oracle_error_nb)
- PRAGMA_EXCE (Exceptionname);
- PRAGMA_INIT_EXCEPTION(exception_name);
- None of the above
Ans : 1
Can we define exceptions twice in same block?
- Yes
- No
- Depends upon
- None of the above
Ans : 3
Can the PL/SQL block process more than one exception at a time?
- Yes
- No
- Depends upon
- None of the above
Ans : 2
Is it possible to have more than one OTHERS clause?
- Possible
- Not possible to have more than one OTHERS clause in the exception section.
- Sometimes possible and not possible
- 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?
- Cursor_Already_Open
- Invalid_Cursor
- A & B
- None of the above
Ans : 3
Which of the following exceptions procedure fail due to an unanticipated problem ?
- no_data_found
- others
- zero_divide
- too_many_rows
Ans : 2
Which of the following keyword allow to associate a user-defined error message ?
- Pragma
- Others
- raise_application_error
- Exception
Ans : 3
Which of the following exception received two or more records, you would include ?
- too_many_rows
- others
- zero_divide
- no_data_found
Ans : 1
Which statement result of not creating an exception handler for a raised exception?
- The program will continue without raising the exception.
- There will be a memory leak.
- Control will pass to the PL/SQL block caller’s exception handler.
- 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?
- no_data_found
- others
- rowtype_mismatch
- too_many_rows
Ans : 2
What is the output for SELECT SAL INTO V_SAL FROM EMP;
- All rows selected
- First record only printed
- Error as “exact fetch returns more than requested number of rows”
- None of the above
Ans : 3
What is the output for the A=10, B=0,C=a/b Dopl(C); ?
- 0
- 10
- 1
- 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