Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Problem calling a MySQL stored procedure which returns a value

$
0
0

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.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>