Bird
0
0

What is wrong with this procedure call?

medium📝 Debug Q7 of 15
SQL - Stored Procedures and Functions
What is wrong with this procedure call?
CREATE PROCEDURE proc_example(IN val INT)
BEGIN
SELECT val;
END;

CALL proc_example(@output);
AUser variable @output is not initialized before call.
BCannot pass a user variable to an IN parameter.
CProcedure call syntax is incorrect; missing parentheses.
DIN parameters cannot be used in SELECT statements.
Step-by-Step Solution
Solution:
  1. Step 1: Check variable initialization

    @output is used as input but not assigned a value before the call.
  2. Step 2: Validate other options

    User variables can be passed, syntax is correct, IN parameters can be selected.
  3. Final Answer:

    User variable @output is not initialized before call. -> Option A
  4. Quick Check:

    Initialize variables before passing [OK]
Quick Trick: Always initialize variables before procedure call [OK]
Common Mistakes:
  • Passing uninitialized variables
  • Misunderstanding procedure call syntax
  • Thinking IN parameters can't be used in queries

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes