I want to call a stored procedure on a MySQL database from an "Execute SQL Task" and store the returned value into a user variable. However I'm getting the error:
[Execute SQL Task] Error: Executing the query "CALL proc1(?);" failed with the following error: "OUT or INOUT argument 1 for routine dbname.proc1 is not a variable or NEW pseudo-variable in BEFORE trigger". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
The configuration is:
- SQLStatement = CALL proc1(?);
- Parameter Mapping:
Variable Name = User::procResult
Direction = Output
Data Type = String
Parameter Name = 0
Parameter Size = -1
The MySQL statement is:
CREATE PROCEDURE proc1 (OUT rs VARCHAR(10)) BEGIN SELECT "Testing" INTO rs; END //
If I call a procedure which doesn't have any parameters, it works fine. It's only when I include the parameter that I get the problem.
Thanks.