为什么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
相关产品推荐
相关产品推荐

