Handling PL/SQL Errors - questions and answers

Handling PL/SQL Errors - questions and answers


1) PL/SQL Exception message consists of -

A) Type of Exception
B) An Error Code
C) A message
D) All mentioned above
View Answer / Hide Answer

ANSWER: D) All mentioned above




2) PL/SQL provides a feature to handle the Exceptions which occur in a PL/SQL Block known as exception Handling.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




3) Which of the following is handled with the help of exception-handling section in an PL/SQL block. For eg, SELECT INTO statement, which does not return any rows.

A) A runtime error
B) A syntax error
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: A) A runtime error




4) 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 / Hide Answer

ANSWER: A) Predefined Exception




5) ________ does not correlate with an oracle error, instead, user_define exceptions usually enforce business rules in situations in which an oracle error would not necessarily occur?

A) Predefined Exception
B) Internal Exception
C) User defined Exception
D) None of the above
View Answer / Hide Answer

ANSWER: C) User defined Exception




6) 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.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




7) Which of the following returns the current error message text?

A) SQLERRM
B) SQLCODE
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: A) SQLERRM




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

A) “User-defined Exception”
B) 1
C) 0
D) None of the above
View Answer / Hide Answer

ANSWER: A) “User-defined Exception”




9) Which PL/SQL warning categories gives Messages for conditions that do not have an effect on performance or correctness, but that you might want to change to make the code more maintainable, such as unreachable code that can never be executed?

A) PERFORMANCE
B) SEVERE
C) INFORMATIONAL
D) All mentioned above
View Answer / Hide Answer

ANSWER: C) INFORMATIONAL




10) 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 / Hide Answer

ANSWER: C) Executable and Header




11) The keyword All is a shorthand way to refer to all warning messages.

A) Yes
B) No
View Answer / Hide Answer

ANSWER: A) Yes


Post your comment