gpt4 book ai didi

MySQL:从函数调用过程

转载 作者:行者123 更新时间:2023-11-29 03:08:27 26 4
gpt4 key购买 nike

是否可以从 MySQL 中的函数调用过程?我收到错误“不允许从函数返回结果集”。我希望将过程调用的结果插入到函数变量中,就像我直接在函数中执行 SELECT INTO 一样。

函数被(简化)定义为

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;

程序(简化)定义为:

create procedure my_procedure(in my_parameter int, out my_result int)
begin
select 1
from dual;
end;

最佳答案

本质上,没有。函数正在寻找数据类型,而不是记录(这是从过程返回的内容)。

关于MySQL:从函数调用过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11850561/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com