What is true about stored procedures?

  1. A stored procedure uses the DELCLARE keyword in the procedure specification to declare formal parameters.

  2. A stored procedure is named PL/SQL block with at least one parameter declaration in the procedure specification.

  3. A stored procedure must have at least one executable statement in the procedure body.

  4. A stored procedure uses the DECLARE keyword in the procedure body to declare formal parameters.


Correct Option: 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 uses the DECLARE keyword in the procedure specification to declare formal parameters. - This option is incorrect. The DECLARE keyword is used in PL/SQL to declare local variables, not formal parameters for a stored procedure.

Option B) A stored procedure is named PL/SQL block with at least one parameter declaration in the procedure specification. - This option is incorrect. While a stored procedure can have parameters, it is not necessary for it to have at least one parameter declaration.

Option C) A stored procedure must have at least one executable statement in the procedure body. - This option is correct. A stored procedure is a named PL/SQL block that contains a series of executable statements. It must have at least one executable statement in its body to perform a specific task or operation.

Option D) A stored procedure uses the DECLARE keyword in the procedure body to declare formal parameters. - This option is incorrect. The DECLARE keyword is used to declare local variables within a PL/SQL block, not formal parameters for a stored procedure.

The correct answer is Option C. This option is correct because a stored procedure must have at least one executable statement in its body to perform a specific task or operation.

Find more quizzes: