SQL Exception Handling MCQ Questions

11. Which Exception is also known as Oracle named exception handler?

A. Predefined Exception
B. Internal Exception
C. User defined Exception
D. None of the above

View Answer


12. When creating a function, in which section will you typically find a return key word?

A. Header Only
B. Declarative
C. Executable and Header
D. Executable and exception handling

View Answer


13. Which of the following returns the current error message text?

A. SQLERRM
B. SQLCODE
C. Both A and B
D. None of the above

View Answer


14. For a user-defined exception, SQLCODE returns 1, and SQLERRM returns ___________.

A. 1
B. User-defined Exception
C. 0
D. Predefined Exception

View Answer


15. Which of the following is true?

A. The keyword All is a shorthand way to refer to all warning messages.
B. In internal exception oracle raises the exception for you implicitly. You still need to declare the exception and handle it, but you don’t need to raise it.
C. An exception handling block is used so that we can avoid the errors in the program
D. All of the above

View Answer


16. Which of the following is a global variable for error handling?

A. "@@ERRORS"
B. "@ERRORS"
C. "@@ERR"
D. "@@ERRORS"

View Answer


17. ERROR_SEVERITY() returns the ________level of the error.

A. State number
B. Full text
C. Severity
D. None of the above

View Answer


18. Which of the following is an Error function used within CATCH block?

A. ERROR_STATUS()
B. ERROR_STATE()
C. ERROR_MSG()
D. None of the above

View Answer


19. Exception handling is possible in SQL Server using _____________

A. FINAL
B. FINALLY
C. THROW
D. THROWS

View Answer


20. Which of the following benefit does Exception handling with the TRY and CATCH blocks provide?

A. Exceptions provide a mechanism to signal errors directly rather than using some side effects
B. Exceptions can be seen by the programmer and checked during the compilation process
C. Exceptions provide a clean way to check for errors without cluttering code
D. All of the above

View Answer






Discussion


* You must be logged in to add comment.