You need to enable JavaScript to run this app. 为什么BigQuery存储过程的OUT参数不返回值,调用后变量返回NULL
优惠活动
大模型
产品
解决方案
定价
更多

为什么BigQuery存储过程的OUT参数不返回值,调用后变量返回NULL

BigQuery 存储过程OUT参数无法返回有效值问题

本人在BigQuery中编写存储过程时,无法定位报错位置,OUT参数没有返回任何有效值。

存储过程定义代码

create procedure if not exists test.GetNumTherapistSessions(
    in LastNamee string,
    out NumSessione int64
)
begin 
    select count(s.SessionNum) as NumSession from test.Session s 
    inner join test.Therapist t on s.TherapistID=t.TherapistID
    where t.LastName=LastNamee;
end

变量声明与存储过程调用代码

declare NumSession int64;
call test.GetNumTherapistSessions("Risk",NumSession);

运行现象

  • 执行上述存储过程调用语句时,初步输出符合预期,流程运行无异常
  • 调用完成后,执行语句查询已声明的输出变量取值:
    select NumSession;
    
  • 该查询返回的NumSession结果为NULL,未获取到有效输出值

内容的提问来源于stack exchange,提问作者Majid Rezaie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.29 08:36:10