PL/SQL stands for "Procedural Language Extension of SQL". PL/SQL uses a block-structured syntax. Each of the logical blocks of PL/SQL can be nested into any number of subblocks. Show
This section contains the PL/SQL MCQs on various topics such as Variables, Constants, Literals, Case, Loop, Continue, Trigger, Cursor, Procedure, etc. These PL/SQL MCQs are written for beginners as well as advanced, practice these MCQs to enhance and test the knowledge of PL/SQL. PL/SQL MCQs Index1) PL/SQL Variables MCQs1. PL/SQL is a –
Answer: B) Block Structured Language Explanation: PL/SQL is a Block Structured Language. Discuss this Question 2. What does PL/SQL stand for?
Answer: A) PL/SQL stands for Procedural Language Extension of SQL Explanation: PL/SQL stands for Procedural Language Extension of SQL. Discuss this Question 3. What is TRUE about PL/SQL functionalities?
Answer: D) All of the above Explanation: TRUE about PL/SQL functionalities –
Discuss this Question 4. Oracle Database's ____ are inherited in PL/SQL.
Answer: D) All of the above Explanation: Oracle Database's portability, robustness and security are inherited in it. Discuss this Question 5. PL/SQL text is made up of lexical units, which are groups of characters and can be classified as –
Answer: D) All of the above Explanation: PL/SQL text is made up of lexical units, which are groups of characters and can be classified as Delimiters, Identifiers, Literals and Comments. Discuss this Question 6. A Variable in PL/SQL should not exceed – Answer: C) 30 Explanation: A Variable in PL/SQL should not exceed 30 characters. Discuss this Question 7. Which of the following is/are TRUE about PL/SQL Variables?
Answer: D) All of the above Explanation: In the case of PL/SQL Variables –
Discuss this Question 8. PL/SQL Variables are by default –
Answer: D) Not Case Sensitive Explanation: PL/SQL Variables are by default not case sensitive. Discuss this Question 9. PL/SQL Variable needs to be declared in the –
Answer: B) Declaration Section Explanation: PL/SQL Variable needs to be declared in the Declaration Section. Discuss this Question 10. The correct syntax to declare PL/SQL variable is –
Answer: A) variable_name [CONSTANT] datatype [NOT NULL] [:= | DEFAULT initial_value] Explanation: The correct syntax to declare PL/SQL variable is – variable_name [CONSTANT] datatype [NOT NULL] [:= | DEFAULT initial_value] Discuss this Question 11. The term ____ refers to a declaration with a size, scale, or precision limit.
Answer: B) Constrained declaration Explanation: The term constrained declaration refers to a declaration with a size, scale, or precision limit. Discuss this Question 12. Which of the following is TRUE about Constrained Declaration?
Answer: A) An unconstrained declaration requires more memory than a constrained declaration Explanation: An unconstrained declaration requires more memory than a constrained declaration. Discuss this Question 13. What is/are the Naming Rules for the PL/SQL Variables?
Answer: D) All of the above Explanation: The Naming Rules for the PL/SQL Variables states that –
Discuss this Question 14. In order to initialize a variable with the value other than NULL, it can be done using which method?
Answer: C) Both A. and B. Explanation: In order to initialize a variable with the value other than NULL, it can be done using the Assignment Operator and the DEFAULT Keyword both. Discuss this Question 15. What is the name of the two variable scopes in PL/SQL?
Answer: C) Local & Global Variable Explanation: The two variable scopes in PL/SQL are Local & Global Variables. Discuss this Question 16. What is the difference between Local & Global Variables?
Answer: D) Variables in an inner block are defined as local variables since they cannot be accessed from the outside whereas the outermost block declares global variables. Explanation: Variables in an inner block are defined as local variables since they cannot be accessed from the outside whereas the outermost block declares global variables. Discuss this Question 2) PL/SQL Constants, Literals, and If MCQs17. ____ are values used in PL/SQL blocks that do not change during execution.
Answer: B) Constants Explanation: Constants are values used in PL/SQL blocks that do not change during execution. Discuss this Question 18. PL/SQL Constant is a/an ____ literal value.
Answer: B) User-defined Explanation: PL/SQL Constant is a User-defined literal value. Discuss this Question 19. Choose the correct syntax to declare a constant.
Answer: A) constant_name CONSTANT datatype := VALUE; Explanation: The correct syntax to declare a constant is – constant_name CONSTANT datatype := VALUE; Discuss this Question 20. What is TRUE about constant_name in PL/SQL Constant?
Answer: C) Both A. and B. Explanation: In case of constant_name in PL/SQL Constant –
Discuss this Question 21. A value is assigned to a constant in PL/SQL at the time of –
Answer: B) Declaration Explanation: A value is assigned to a constant in PL/SQL at the time of Declaration. Discuss this Question 22. ____ are values which do not have an identifier and are numeric, character, string, or boolean.
Answer: B) Literals Explanation: Literals are values which do not have an identifier and are numeric, character, string, or Boolean. Discuss this Question 23. Which is the correct example of the literal of type Boolean.
Answer: C) Both A. and B. Explanation: NULL, TRUE, etc. Are the examples of the literal of type Boolean. Discuss this Question 24. Select the correct statement.
Answer: A) PL/SQL literals are case-sensitive Explanation: PL/SQL literals are case-sensitive. Discuss this Question 25. Which of the following is NOT a type of PL/SQL literal?
Answer: D) Check Explanation: Type of PL/SQL literals are Numeric, Character, String, Boolean and Date & Time. Discuss this Question 26. Which of the following is Numeric literal? Answer: D) All of the above Explanation: Examples of Numeric literals are 1234, 12.22, 0 etc. Discuss this Question 27. Which of the following is NOT a Boolean literal? Answer: C) HELLO Explanation: HELLO is NOT a Boolean literal. TRUE, FALSE, NULL etc. are Boolean literals. Discuss this Question 28. Which of the following is a Character literal? Answer: D) All of the above Explanation: B, 4, % etc. are all Character literals. Discuss this Question 29. What programming languages features are used in PL/SQL?
Answer: C) Both A. and B. Explanation: Programming languages features that are used in PL/SQL are iterative and conditional statements. Discuss this Question 30. Which of the following is correct syntax of IF statement?
Answer: D) All of the above Explanation: Explanation: Different Syntax of If statements are –
Discuss this Question 31. IF-THEN syntax is used –
Answer: B) If the condition is TRUE, then you want statements to be executed Explanation: If the condition is TRUE, then you want statements to be executed Discuss this Question 32. IF-THEN-ELSE syntax is used –
Answer: A) Depending on whether the condition is TRUE or FALSE, you may want to execute one set of statements or another set. Explanation: Depending on whether the condition is TRUE or FALSE, you may want to execute one set of statements or another set. Discuss this Question 33. IF-THEN-ELSIF syntax is used –
Answer: C) As long as condition1 is TRUE, then one set of statements will be executed, and when condition2 is TRUE, another set will be executed. Explanation: As long as condition1 is TRUE, then one set of statements will be executed, and when condition2 is TRUE, another set will be executed. Discuss this Question 34. ____ executes the corresponding code whenever a TRUE condition is found. Otherwise, the condition cannot be checked again.
Answer: B) IF-THEN-ELSE statement Explanation: IF-THEN-ELSE executes the corresponding code whenever a TRUE condition is found. Otherwise, the condition cannot be checked again. Discuss this Question 35. In the absence of a condition, the ELSE part of the ____ statement will be executed.
Answer: A) IF-THEN-ELSE statement Explanation: In the absence of a condition, the ELSE part of the IF-THEN-ELSE statement will be executed. Discuss this Question 36. Which portion is optional in IF statements?
Answer: C) ELSE Explanation: ELSE and ELSIF portions are optional in IF statements. Discuss this Question 3) PL/SQL CASE, LOOP, CONTINUE, GOTO MCQs37. CASE statement uses which keyword to work like IF statement? Answer: C) WHEN Explanation: CASE statement uses WHEN keyword to work like IF statement. Discuss this Question 38. What are the selectors in case of CASE statement?
Answer: D) All of the above Explanation: The selectors in case of CASE statement are Variable, Function or Expression. Discuss this Question 39. Evaluation of CASE statement is done –
Answer: B) TOP to BOTTOM Explanation: Evaluation of CASE statement is done TOP to BOTTOM. Discuss this Question 40. By using PL/SQL ____, you can repeatedly execute one or more statements over and over again. Answer: A) Loops Explanation: By using PL/SQL loops, you can repeatedly execute one or more statements over and over again. Discuss this Question 41. PL/SQL Loops are also known as –
Answer: B) Iterative Control Statements Explanation: PL/SQL Loops are also known as Iterative Control Statements. Discuss this Question 42. What is the syntax of PL/SQL Loop?
Answer: C) LOOP Sequence of statements; END LOOP; Explanation: Syntax of PL/SQL Loop is – LOOP Sequence of statements; END LOOP; Discuss this Question 43. How many types of PL/SQL Loops are there? Answer: B) 4 Explanation: There are 4 types of PL/SQL loops. Discuss this Question 44. Which of the following is correct type of PL/SQL Loop?
Answer: D) All of the above Explanation: Types of PL/SQL Loops are –
Discuss this Question 45. A/An _______ loop in PL/SQL ensures that at least one statement is executed before the loop terminates. Answer: D) Exit Explanation: An exit loop in PL/SQL ensures that at least one statement is executed before the loop terminates. Discuss this Question 46. Which of the following is TRUE while using PL/SQL Exit Loop?
Answer: D) All of the above Explanation: While using PL/SQL Exit Loop –
Discuss this Question 47. The PL/SQL ____ loop runs a series of statements as long as a condition is true, so it can be used in a series of statements. Answer: A) While Explanation: The PL/SQL While loop runs a series of statements as long as a condition is true, so it can be used in a series of statements. Discuss this Question 48. What is the correct syntax of WHILE Loop?
Answer: A) WHILE LOOP statements; END LOOP; Explanation: The correct syntax of WHILE Loop is – constant_name CONSTANT datatype := VALUE;2 Discuss this Question 49. When you want to execute a series of statements repeatedly, you use the PL/SQL ____ loop. Answer: C) For Explanation: When you want to execute a series of statements repeatedly, you use the PL/SQL for loop. Discuss this Question 50. The counter in PL/SQL FOR Loop is by default incremented by – Answer: B) 1 Explanation: The counter in PL/SQL FOR Loop is by default incremented by 1. Discuss this Question 51. Which of the following is TRUE while using PL/SQL FOR Loop?
Answer: D) All of the above Explanation: While using PL/SQL FOR Loop –
Discuss this Question 52. PL/SQL ____ statement initiates the next iteration of a loop, skipping any code in between, by exiting the loop from the reminder in its body either conditionally or unconditionally.
Answer: C) Continue Explanation: PL/SQL Continue statement initiates the next iteration of a loop, skipping any code in between, by exiting the loop from the reminder in its body either conditionally or unconditionally. Discuss this Question 53. In which Oracle does the PL/SQL Continue Statement is supported?
Answer: D) Oracle 11g Explanation: Oracle 11g supports PL/SQL Continue statement. Discuss this Question 54. A ____ statement in PL/SQL allows you to jump from this statement to a specific statement label within the same subprogram within a PL/SQL block. Answer: B) GOTO Explanation: A GOTO statement in PL/SQL allows you to jump from this statement to a specific statement label within the same subprogram within a PL/SQL block. Discuss this Question 55. The symbol in which the label_name is encapsulated in PL/SQL GOTO statement is – Answer: D) <<>> Explanation: The symbol in which the label_name is encapsulated in PL/SQL GOTO statement is << >>. Discuss this Question 56. What is/are the correct restriction(s) on GOTO statement?
Answer: D) All of the above Explanation: The restrictions on the GOTO statement are –
Discuss this Question 4) PL/SQL Procedure MCQs57. PL/SQL Procedure consists of –
Answer: C) Header and Body Explanation: PL/SQL Procedure consists of Header and Body. Discuss this Question 58. What is TRUE about header?
Answer: A) Parameters and variables are contained in the header of the procedure Explanation: Parameters and variables are contained in the header of the procedure. Discuss this Question 59. How much number of ways is there to pass the parameters in procedure? Answer: C) 3 Explanation: There are 3 numbers of ways to pass the parameters in the procedure. Discuss this Question 60. Which of the following are the pass parameters in procedure?
Answer: D) All of the above Explanation: The pass parameters in procedure are – Discuss this Question 61. Which of the following pass parameters can be referenced by procedure?
Answer: C) IN, INOUT Explanation: IN and INOUT pass parameters can be reference by procedure. Discuss this Question 62. Which of the following cannot be overwritten by procedure?
Answer: A) IN Explanation: IN pass parameter cannot be overwritten by procedure. Discuss this Question 63. Which of the following can be performed in PL/SQL Procedure?
Answer: D) All of the above Explanation: In PL/SQL Procedure, the following functions can be performed – Discuss this Question 5) PL/SQL Function MCQs64. What is the difference between PL/SQL Function and PL/SQL Procedure?
Answer: B) PL/SQL Procedure may or may not return the value whereas PL/SQL Function must have to return the value Explanation: PL/SQL Procedure may or may not return the value whereas PL/SQL Function must have to return the value. Discuss this Question 65. Which of the following is NOT present in the syntax of PL/SQL function?
Answer: D) None of the above Explanation: Function_name, [OR REPLACE], Optional Parameter List, IN are all present in the syntax of PL/SQL function. Discuss this Question 66. PL/SQL function must contain a –
Answer: C) Return Statement Explanation: PL/SQL function must contain a Return Statement. Discuss this Question 67. AS Keyword is used in the PL/SQL function in order to create a –
Answer: D) Standalone Function Explanation: AS keyword is used in the PL/SQL function in order to create a Standalone Function. Discuss this Question 68. We can demonstrate which of the following in a PL/SQL function?
Answer: D) All of the above Explanation: We can demonstrate Declare, Define and Invoke in PL/SQL function. Discuss this Question 69. Which of the following is /are TRUE about calling a PL/SQL function?
Answer: D) All of the above Explanation: All the below points are TRUE about calling a PL/SQL function –
Discuss this Question 70. The call function returns program control to the ____ after successful completion of the defined task.
Answer: C) Main Program Explanation: The call function returns program control to the main program after successful completion of the defined task. Discuss this Question 71. Calling a function requires that the parameters be provided along with the ____, and if the function returns a value, that value can be stored.
Answer: A) Function Name Explanation: Calling a function requires that the parameters be provided along with the function name, and if the function returns a value, that value can be stored. Discuss this Question 72. It is called ____ when the subprogram calls itself and ____ is the process.
Answer: B) Recursive Call, Recursion Explanation: It is called recursive call when the subprogram calls itself and recursion is the process. Discuss this Question 73. In order to remove the PL/SQL function, which function is used?
Answer: D) DROP FUNCTION Explanation: In order to remove the PL/SQL function, DROP FUNCTION is used. Discuss this Question 6) PL/SQL Cursor MCQs74. Oracle creates ____ when SQL statements are processed.
Answer: B) Context Areas Explanation: Oracle creates context areas when SQL statements are processed. Discuss this Question 75. In the contexts created by Oracle, a cursor represents a ____.
Answer: C) Pointer Explanation: In the contexts, create by Oracle, a cursor represents a Pointer. Discuss this Question 76. An SQL ____ refers to a program that retrieves and processes one row at a time, based on the results of the SQL statement.
Answer: A) Cursor Explanation: An SQL cursor refers to a program that retrieves and processes one row at a time, based on the results of the SQL statement. Discuss this Question 77. How many types of PL/SQL Cursor are there? Answer: B) 2 Explanation: There are 2 types of PL/SQL Cursors. Discuss this Question 78. Which of the following is/are the type(s) of the PL/SQL Cursor?
Answer: C) Both A. and B. Explanation: Implicit and Explicit Cursors are the types of PL/SQL Cursor. Discuss this Question 79. Which of the following PL/SQL Cursor is automatically generated by Oracle?
Answer: A) Implicit Explanation: Implicit Cursor is automatically generated by Oracle. Discuss this Question 80. The Implicit cursors are created in order to process the ____ statements. Answer: C) DML Explanation: The implicit cursors are created in order to process the DML statements such as INSERT, DELETE, UPDATE, etc. Discuss this Question 81. Which of the following is/are an/the implicit cursor's attribute(s)?
Answer: D) All of the above Explanation: %FOUND, %ROWCOUNT, %OPEN and %NOTFOUND are all the implicit cursor's attributes. Discuss this Question 82. What is TRUE about %FOUND in PL/SQL Cursor?
Answer: A) If any DML statement, such as INSERT, DELETE or UPDATE, effects one or more rows, or if a SELECT INTO statement returns at least one row, this method returns TRUE Explanation: In the case of %FOUND, if any DML statement, such as INSERT, DELETE or UPDATE, effects one or more rows, or if a SELECT INTO statement returns at least one row, this method returns TRUE. Discuss this Question 83. What is TRUE about %ISOPEN in PL/SQL Cursor?
Answer: C) Because SQL cursors are automatically closed after execution of their associated SQL statements, the function always returns FALSE for implicit cursors Explanation: In the case of %ISOPEN, Because SQL cursors are automatically closed after execution of their associated SQL statements, the function always returns FALSE for implicit cursors. Discuss this Question 84. What is TRUE about %ROWCOUNT in PL/SQL Cursor?
Answer: B) Results are returned for DML statements such as inserting, deleting, and updating records, or for those returned by a SELECT INTO command Explanation: Results are returned for DML statements such as inserting, deleting, and updating records, or for those returned by a SELECT INTO command. Discuss this Question 85. For ____ control over the context area, programmers can define explicit cursors.
Answer: A) Greater Explanation: For greater control over the context area, programmers can define explicit cursors. Discuss this Question 86. In the PL/SQL Block, Explicit cursors are defined in ___________ section.
Answer: B) Declaration Explanation: In the PL/SQL Block, Explicit cursors are defined in Declaration Section. Discuss this Question 87. On the ____ statements, the explicit cursors are created which return rows more than one. Answer: C) SELECT Explanation: On the SELECT statements, the explicit cursors are created which return rows more than one. Discuss this Question 88. Which of the following is the correct syntax to create the Explicit Cursor?
Answer: D) CURSOR cursor_name IS select_statement; Explanation: CURSOR cursor_name IS select_statement; is the correct syntax to create the Explicit Cursor. Discuss this Question 89. There are 4 steps to work on Explicit Cursor:
Select the correct order of the above 4 steps to work on Explicit Cursor.
Answer: C) I > II > III > IV Explanation: This is the order in which 4 steps will be performed to work on Explicit Cursor:
Discuss this Question 90. Which of the following is the correct syntax to declare explicit cursor?
Answer: D) constant_name CONSTANT datatype := VALUE;6 Explanation: The correct syntax to declare explicit cursor is – constant_name CONSTANT datatype := VALUE;6 Discuss this Question 91. Which of the following is the correct syntax to fetch the cursor?
Answer: A) FETCH cursor_name INTO variable_list; Explanation: FETCH cursor_name INTO variable_list is the correct syntax to fetch the cursor. Discuss this Question 92. Which clause is used to open the cursor? Answer: C) OPEN Explanation: OPEN is the clause used to open the cursor. Discuss this Question 93. Which clause is used to close the cursor? Answer: D) CLOSE Explanation: CLOSE clause is used to close the cursor. Discuss this Question 7) PL/SQL Triggers MCQs94. Whenever a specified event occurs, the ____ is automatically triggered by the Oracle engine.
Answer: B) Trigger Explanation: Whenever a specified event occurs, the trigger is automatically triggered by the Oracle engine. Discuss this Question 95. Which of the following is TRUE about PL/SQL Trigger?
Answer: D) None of the above Explanation: The following points are TRUE about PL/SQL Trigger –
Discuss this Question 96. In which event(s) trigger is executed?
Answer: D) All of the above Explanation: Trigger is executed when -
Discuss this Question 97. Which of the following is database operation?
Answer: D) All of the above Explanation: SERVERERROR, STARTUP, SHUTDOWN, LOGON and LOGOFF are all the database operations. Discuss this Question 98. Which of the following is not an advantage of trigger?
Answer: C) Tables are replicated asynchronously Explanation: Trigger has this advantage of the tables to be replicated synchronously and not asynchronously. Discuss this Question 99. What does INSERT or UPDATE or DELETE clauses do in Trigger syntax?
Answer: A) DML Operation is performed Explanation: INSERT or UPDATE or DELETE clauses performs the DML Operations in Trigger syntax. Discuss this Question 100. Which clause(s) is/are used to specify when the trigger will get executed?
Answer: D) All of the above Explanation: BEFORE or AFTER or INSTEAD OF clauses are used to specify when the trigger will get executed. Discuss this Question 101. Which clause is used to create trigger on a view?
Answer: C) INSTEAD OF Explanation: INSTEAD OF clause is used to create trigger on a view. Discuss this Question 102. What is the difference between OF column_name and ON table_name in trigger syntax?
Answer: A) OF column_name specifies the column name that is needed to be updated whereas ON table_name specified the table name that is associated with the trigger. Explanation: OF column_name specifies the column name that is needed to be updated whereas ON table_name specified the table name that is associated with the trigger. Discuss this Question 103. What does FOR EACH ROW clause do in Trigger syntax?
Answer: C) Both A. and B. Explanation: In the case of FOR EACH ROW –
Discuss this Question 104. WHEN condition is valid for which triggers?
Answer: B) Row Level Triggers Explanation: WHEN condition is valid for Row Level Triggers. Discuss this Question 105. Which of the following statement is TRUE?
Answer: A) Table-level triggers do not have access to OLD and NEW references. Record-level triggers use OLD and NEW references. Explanation: Table-level triggers do not have access to OLD and NEW references. Record-level triggers use OLD and NEW references. Discuss this Question 106. Which keyword is used to query the table in the same trigger? Answer: B) AFTER Explanation: AFTER keyword is used to query the table in the same trigger. Discuss this Question 107. What does REFERENCING OLD AS o NEW AS n clause do in trigger?
Answer: C) Both A. and B. Explanation: REFERENCING OLD AS o NEW AS n clause is used to refer the old and new values for different DML statements. Discuss this Question 108. Which of the following is an advantage of trigger?
Answer: D) All of the above Explanation: The advantages of trigger are –
Discuss this Question 109. Which of the following clause is not present in the syntax of trigger?
Answer: C) CURSOR Explanation: CURSOR clause is not present in the syntax of trigger. Discuss this Question 110. Tables, views, schemas, or databases can be defined as ________ for events.
Answer: C) Triggers Explanation: Tables, views, schemas, or databases can be defined as triggers for events. Discuss this Question 8) PL/SQL Exception MCQs111. Errors that are encountered during the execution of the program are referred to as ____ in PL/SQL.
Answer: C) EXCEPTION Explanation: Errors that are encountered during the execution of the program are referred to as exceptions in PL/SQL. Discuss this Question 112. How many types of exceptions are there? Answer: A) 2 Explanation: There are 2 types of exceptions. Discuss this Question 113. Which of the following is/are an/the type(s) of exceptions?
Answer: C) Both A. and B. Explanation: System-defined and User-defined exceptions are both the types of exceptions. Discuss this Question 114. Which command is used in order to raise an exception explicitly? Answer: C) RAISE Explanation: With the help of RAISE command, one can easily raise an exception explicitly. Discuss this Question 115. Which of the following is TRUE about User-defined exceptions?
Answer: C) Both A. and B. 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. Discuss this Question 116. What is the syntax of User-defined exceptions?
Answer: A) DECLARE my-exception EXCEPTION; Explanation: DECLARE my-exception EXCEPTION is the syntax of user-defined exceptions. Discuss this Question 117. Which of the following clause does not comes in the syntax while raising an exception? Answer: C) CLOSE Explanation: CLOSE clause doesn't come in the syntax while raising an exception. Discuss this Question 118. When SELECT INTO returns no rows, which pre-defined exception is raised?
Answer: B) NO_DATA_FOUND Explanation: When SELECT INTO returns no rows, NO_DATA_FOUND pre-defined exception is raised. Discuss this Question 119. When ACCESS_INTO_NULL exception does is raised?
Answer: C) An automatic assignment of a value to a NULL object raises this exception. Explanation: ACCESS_INTO_NULL exception is raised when an automatic assignment of a value to a NULL object raises this exception. Discuss this Question 120. Which exception is rose when there is no other clause in the "WHEN" clause of a CASE statement, and none of the choices in the "WHEN" clause have been selected?
Answer: D) CASE_NOT_FOUND Explanation: CASE_NOT_FOUND exception is rose when there is no other clause in the "WHEN" clause of a CASE statement, and none of the choices in the "WHEN" clause have been selected. Discuss this Question 121. When COLLECTION_IS_NULL exception is raised?
Answer: B) The exception is thrown when an uninitialized nested table or varray is attempted to be populated with collection methods other than exist, or when an element of an uninitialized nested table or varray is attempted to be assigned values. Explanation: COLLECTION_IS_NULL exception is raised when an uninitialized nested table or varray is attempted to be populated with collection methods other than exist, or when an element of an uninitialized nested table or varray is attempted to be assigned values. Discuss this Question 122. When DUP_VAL_ON_INDEX exception does is raised?
Answer: A) A unique index column with duplicate values is raised when this error occurs. Explanation: DUP_VAL_ON_INDEX exception is raised when an attempt is made to close an unopened cursor or perform a cursor operation without permission. Discuss this Question 123. An exception which occurs when attempting to access a database without connecting to it is –
Answer: C) NOT_LOGGED_ON Explanation: An exception which occurs when attempting to access a database without connecting to it is NOT_LOGGED_ON. Discuss this Question 124. Which exception is raised when there is an internal problem in PL/SQL?
Answer: D) PROGRAM_ERROR Explanation: PROGRAM_ERROR is raised when there is an internal problem in PL/SQL. Discuss this Question 125. When ROWTYPE_MISMATCH exception is raised?
Answer: C) Cursors raise this exception when they seek values in variables of incompatible types. Explanation: Cursors raise the exception ROWTYPE_MISMATCH when they seek values in variables of incompatible types. Discuss this Question 126. When SELF_IS_NULL exception is raised?
Answer: B) When a member method is invoked on an object type, but its instance has not been initialized, this exception is raised. Explanation: SELF_IS_NULL exception is raised when a member method is invoked on an object type, but its instance has not been initialized, this exception is raised. Discuss this Question 127. A PL/SQL exception, which occurs when a memory error occurs?
Answer: D) STORAGE_ERROR Explanation: A PL /SQL exception, which occurs when a memory error occurs, is STORAGE_ERROR. Discuss this Question 128. The exception thrown when more than one row is returned from a SELECT INTO statement?
Answer: C) TOO_MANY_ROWS Explanation: The exception thrown when more than one row is returned from a SELECT INTO statement is TOO_MANY_ROWS. Discuss this Question 129. When VALUE_ERROR exception is raised when errors relating to arithmetic, conversion, truncation, or size constraints occur. Which of the following is true about the execution section of PL SQL block?Which of the following is true about the execution section of a PL/SQL block? It is a mandatory section.
Which of the following is not true about the PL SQL functions?Q 19 - Which of the following is not true about the PL/SQL functions? A - A PL/SQL function is same as a procedure except that it returns a value.
Which of the following is true about the PL SQL data structure very?Which of the following is true about the PL/SQL data structure VARRAY? It also has a maximum size that cannot be changed. A VARRAY type is created with the CREATE VARRAY statement, at the schema level. Maximum size of a VARRAY can be changed using the ALTER TYPE statement.
How can a PL SQL block be executed?Execution Section
This is the second section of the PL/SQL block; the execution section always starts with the BEGIN keyword and ends with the END keyword. In this block, we just need to write at least one executable expression even if it is null, which means it is a mandatory section of the PL/SQL block.
|