PL SQL MCQ Questions 5

PL SQL MCQ Questions 5

PL-SQL-Objective-Questions-NareshITWhich collection exception is raised when a subscript exceeds in a collection?

  1. VALUE_ERROR
  2. COLLECTION_IS_NULL
  3. SUBSCRIPT_BEYOND_COUNT
  4. SUBSCRIPT_OUTSIDE_LIMIT

Ans : 3


Which exception is raised when a nonexistent element of an associative array?

  1. NO_DATA_FOUND
  2. COLLECTION_IS_NULL
  3. SUBSCRIPT_BEYOND_COUNT
  4. SUBSCRIPT_OUTSIDE_LIMIT

Ans : 1


In which subprogram a RETURN statement does not return a value ?

  1. In Procedures
  2. In Functions
  3. Both A & B
  4. None of the above

Ans : 1


Which part of a subprogram heading is optional?

  1. Name of the subprogram
  2. Declaration part of a subprogram
  3. Parameters
  4. Exception handling part

Ans : 3


Which of the following is not a subprogram?

  1. Procedure
  2. Function
  3. Package
  4. Anonymous PL/SQL block

Ans :  3


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Where can a subprogram be created?

  1. Inside a PL/SQL block or a package only.
  2. Inside a PL/SQL block, inside a package, or at schema level.
  3. Inside a package only.
  4. Inside a PL/SQL block only.

Ans : 2


Which of the following subprogram is stored in the database?

  1. Standalone subprogram
  2. Nested subprogram in an anonymous block
  3. Package subprogram
  4. Standalone and nested subprogram

Ans : 1


When should forward declaration be used in procedures?

  1. Always for nested procedures
  2. If nested subprograms in the same PL/SQL block invoke each other
  3. For packaged subprograms always
  4. For two standalone subprograms invoking each other

Ans : 2


What is a standalone subprogram?

  1. A subprogram created at the schema level
  2. A subprogram created at the database level
  3. A subprogram created at the user level
  4. A subprogram created at the session level

Ans : 1


Which of the following part of a PL/SQL subprogram is mandatory?

  1. Executable and exception handling part only
  2. Declaration, Executable and Exception handling part
  3. Declaration and Executable part
  4. Executable part only

Ans : 4


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Differentiates a declaration part of a subprogram from an anonymous block?

  1. The declaration part of a subprogram never begins with DECLARE keyword.
  2. Declaration part of a subprogram is not mandatory but anonymous block is mandatory.
  3. Declaration of a subprogram can be written after the execution but not possible in anblock.
  4. None of the above

Ans : 1


How many RETURN statements can a function have?

  1. Zero or more
  2. Zero or one
  3. Always one only
  4. One or more

Ans : 4


Which of the following is incorrect about functions?

  1. A function is a module that returns a value.
  2. A function is a standalone executable statement.
  3. A function can be said to have a datatype.
  4. A function can be used in place of an expression in a PL/SQL statement.

Ans : 2


What is a standalone function?

  1. It is the function created in memory
  2. It is the function inside another PL/SQL lock
  3. It is the function that is stored in the database
  4. It is the function that cannot have any parameters

Ans : 3


Which of the following is not a difference between procedure and function?

  1. Functions can be called from SQL whereas procedures cannot be called.
  2. Function can be used in place of an expression whereas a procedure can’t be used so.
  3. The return statement is mandatory for a function which is not for a procedure
  4. Functions are used for executing business logic and computation but a procedure is not.

Ans : 4


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


What does a return statement in a function do?

  1. It returns control to the calling program and returns the results of the function.
  2. It returns control to the calling program only if there are no results to show.
  3. It only returns the results of the function if any.
  4. It terminates the function without return any results & returns control to the calling program.

Ans : 1


What should be done to change the definition of an existing function?

  1. DROP the function and create it again with CREATE function syntax.
  2. Use ALTER function to re-create the function
  3. A function once created cannot be changed later
  4. Use CREATE or REPLACE to overwrite the existing function.

Ans : 4


Where are functions normally used?

  1. To perform computation
  2. To do some business logic
  3. To transfer data
  4. To take IN OUT parameters

Ans : 1


Which of the following is incorrect about a RETURN statement?

  1. A function can have more than one RETURN statement.
  2. All the RETURN statements is executed each time the function is called.
  3. The RETURN statement can accept any expression for evaluation and return.
  4. It is processed, the function terminates immediately and returns plsql block;

Ans : 2


Which of the following subprograms can use parameters?

  1. Procedures and Functions
  2. Procedures only
  3. Functions only
  4. Packages only

Ans : 1


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


What is the method passed actual & formal parameters refer to same memory location?

  1. By Reference
  2. By Value
  3. By copy
  4. By default values

Ans : 1


Which are the optional parts of a formal parameter declaration?

  1. Name, Datatype, Mode and default value
  2. Datatype, Mode and default value
  3. Mode and default value
  4. Default value only

Ans : 3


Which of the following is incorrect about actual parameters in a procedure?

  1. These are the expressions placed in the parameter list of the actual call to the procedure.
  2. Corresponding actual and formal parameters must have compatible datatypes.
  3. Same names should be given for formal and actual subprogram parameter always.
  4. None of the above

Ans :  3


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Read More PL/SQL Objective Questions and Answers

Click Here
Click Here
Click Here
PL/SQL Objectives 1
PL/SQL Objectives 2
PL/SQL Objectives 3
PL/SQL Objectives 4
PL/SQL Objectives 5
PL/SQL Objectives 6
PL/SQL Objectives 7
PL/SQL Objectives 8
PL/SQL Objectives 9
PL/SQL Objectives 10
PL/SQL Objectives 11
PL/SQL Objectives 12
PL/SQL Objectives 13
PL/SQL Objectives 14
PL/SQL Objectives 15

Share this post