Jump to content

Using OUT parameter in MySQL stored procedure?


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 )
SELECT Temperature into var1 FROM `interface`.`setpoints` WHERE Area = 1;
SELECT Temperature into var2 FROM `interface`.`setpoints` WHERE Area = 2;
SELECT var1, var2;

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...