Which two describe a stored procedure?

  1. A stored procedure is typically written in SQL.

  2. A stored procedure is a named PL/SQL block that can accept parameters

  3. A stored procedure is a type of PL/SQL subprogram that performs an action

  4. A stored procedure has three parts: the specification, the body, and the exception handler part

  5. The executable section of a stored procedure contains statements that assign values, control execution, and return values to the calling environment.


Correct Option: B,C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) A stored procedure is typically written in SQL - This option is incorrect. While stored procedures can be written in SQL, they can also be written in other programming languages such as PL/SQL.

Option B) A stored procedure is a named PL/SQL block that can accept parameters - This option is correct. A stored procedure is a named PL/SQL block that can accept parameters. It allows you to encapsulate and execute a set of SQL statements and PL/SQL code.

Option C) A stored procedure is a type of PL/SQL subprogram that performs an action - This option is correct. A stored procedure is a type of PL/SQL subprogram that performs a specific action or set of actions.

Option D) A stored procedure has three parts: the specification, the body, and the exception handler part - This option is incorrect. While it is true that a stored procedure can have three parts (specification, body, and exception handler), it is not a mandatory requirement. A stored procedure can have only a body or a body with an exception handler.

Option E) The executable section of a stored procedure contains statements that assign values, control execution, and return values to the calling environment - This option is incorrect. While the executable section of a stored procedure can contain statements that assign values, control execution, and return values, it is not the only section of a stored procedure. A stored procedure can also have a declaration section where variables are declared and initialized.

The correct answer is B, C. These options correctly describe a stored procedure as a named PL/SQL block that can accept parameters and performs a specific action or set of actions.

Find more quizzes: