Server Action - How To Access MySQL Stored Procedure "Out" Parameter?

I use a lot of MySQL stored procedures in my work. Often I want to return a value after running a stored procedure, and I would really appreciate Server Actions giving me access to a stored procedure’s out value.

A common way to do this in MySQL is like this:

-- test_out(input_string, output_string)
CALL test_out("Hello", @the_output);
SELECT @the_output AS returned_value;

Which in MySQL Workbench, gives me the result I expect:

hello_good

So I am trying to replicate this structure within a custom database query. After a lot of attempts at how to format the query, Wappler will let me save this format:

However when I test run the query, I get the following message:

hello_bad_message

I’ve also tried this, which I’m not allowed to save… I get messages about parameters being wrong.

-- test_out(input_string, output_string)
CALL test_out(:P1, @the_output);
SELECT @the_output AS returned_value;

Is there a way to do this which I am missing?

If what I want is not possible now, could a new feature be added to Wappler to allow me to use the mySQL variables like @the_output?

Thanks!

Best wishes,
Antony.

=======================================

DELIMITER //
CREATE PROCEDURE test_out ( IN string_in VARCHAR(128), OUT string_out VARCHAR(128))
BEGIN
	SET string_out = string_in;
END 
// DELIMITER ;
Community Page
Last updated: