Jump to content

Using OUT parameter in MySQL stored procedure?


Ness

Recommended Posts

How can I get multiple values back from multiple SQL statements in a stored procedure in MySQL?

Stored Procedure:

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_test`(OUT var1 INT, OUT var2 INT )
BEGIN
SELECT Temperature into var1 FROM `interface`.`setpoints` WHERE Area = 1;
SELECT Temperature into var2 FROM `interface`.`setpoints` WHERE Area = 2;
SELECT var1, var2;
END

In MySQL Workbench:

CALL `interface`.`get_test`(@a1,@a2);

Result Grid shows:
var1 | var2
750  | 850

 

In UniLogic my Query is:
 

CALL get_test(:a,:b);

The query executes successfully but doesn't return any values. The two tags tied to the Query Outputs keep their current values and aren't changed.

Do I just need the proper SQL incantation to get this working? Or are out parameters not supported with UniLogic? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.