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 DELCLARE keyword in the procedure specification to declare formal parameters. This option is incorrect. A stored procedure in PL/SQL uses the DECLARE keyword to declare local variables, not formal parameters.

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 parameter declarations in the procedure specification, it is not a requirement for a stored procedure to have at least one parameter.

Option C) A stored procedure must have at least one executable statement in the procedure body. This option is correct. In PL/SQL, a stored procedure must have at least one executable statement in its procedure body. This means that the procedure must contain code that performs an action or manipulates data.

Option D) A stored procedure uses the DECLARE keyword in the procedure body to declare formal parameters. This option is incorrect. As mentioned earlier, a stored procedure uses the DECLARE keyword to declare local variables, not formal parameters.

The correct answer is C. This option is correct because a stored procedure must have at least one executable statement in its procedure body.

Find more quizzes: