Pl/Sql - Exception MCQ Questions And Answers
Exception MCQs : This section focuses on "Exception" in Pl/Sql. These Multiple Choice Questions (MCQs) should be practiced to improve the Pl/Sql skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.
1. PL/SQL supports programmers to catch such conditions using ________ block in the program
A. Try
B. Throw
C. Catch
D. Exception
View Answer
Ans : D
Explanation: PL/SQL supports programmers to catch such conditions using EXCEPTION block in the program
2. How many types of exceptions?
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : B
Explanation: There are two types of exceptions : System-defined exceptions and User-defined exceptions
3. An exception is an error condition during a program execution.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, An exception is an error condition during a program execution.
4. Which attribute is used to raise exception?
A. Open
B. Select
C. Raise
D. Try
View Answer
Ans : C
Explanation: RAISE exception_name;
5. A _____ exception must be declared and then raised explicitly.
A. system-defined
B. user-defined
C. both a and b
D. None of the above
View Answer
Ans : B
Explanation: A user-defined exception must be declared and then raised explicitly.
6. What is the Oracle Error Code for ACCESS_INTO_NULL?
A. 6592
B. 6531
C. 1722
D. 6530
View Answer
Ans : D
Explanation: Oracle Error : 06530
7. Which of the following is TRUE about User-defined exceptions?
A. Users can explicitly raise an exception by using a RAISE statement
B. RAISE_APPLICATION_ERROR can be used to raise a user-defined exception explicitly
C. both a and b
D. None of the above
View Answer
Ans : C
Explanation: Users can explicitly raise an exception by using a RAISE statement or DBMS_STANDARD.RAISE_APPLICATION_ERROR can be used to raise a user-defined exception explicitly.
8. What is the syntax of User-defined exceptions?
A. DECLARE my-exception EXCEPTION;
B. DECLARE EXCEPTION;
C. DECLARE my-exception;
D. EXCEPTION;
View Answer
Ans : A
Explanation: DECLARE my-exception EXCEPTION is the syntax of user-defined exceptions.
9. Which of the following clause does not comes in the syntax while raising an exception?
A. DECLARE
B. WHEN
C. CLOSE
D. END
View Answer
Ans : C
Explanation: CLOSE clause doesn't come in the syntax while raising an exception.
10. Exceptions are raised by the database server automatically whenever there is any internal database error.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, Exceptions are raised by the database server automatically whenever there is any internal database error.
Discussion