Is it possible to call a procedure from a function in MySQL? I get the error "not allowed to return a result set from a function." I want the results of the procedure call to be inserted into the function variables the same as if I had done a SELECT INTO directly in the function.
The function is (simplified) defined as
create function my_function()
returns int deterministic
begin
declare some_parameter int;
declare the_result int;
call my_procedure(some_parameter, the_result)
return the_result;
end;
The procedure is (simplified) defined as:
create procedure my_procedure(in my_parameter int, out my_result int)
begin
select 1
from dual;
end;