简体   繁体   English

通过命名参数调用 BigQuery 存储过程

[英]Call BigQuery Stored Procedure by naming parameters

I have a BigQuery stored procedure that is defined like this:我有一个 BigQuery 存储过程,其定义如下:

CREATE OR REPLACE PROCEDURE proc_name(
    param_1 INT64,
    param_2 INT64,
    param_3 DATE
)
BEGIN
//CODE
END

When I call the procedure by doing something like this, I have no issues:当我通过做这样的事情来调用程序时,我没有任何问题:

CALL proc_name(1,1,'2022-11-23')

However, I'd like to be able to call it by naming the parameters as I can't always ensure the order they are passed through in is the same order they are declared, for example:但是,我希望能够通过命名参数来调用它,因为我不能总是确保它们传递的顺序与它们声明的顺序相同,例如:

CALL proc_name(
  param_2 = 10
  param_3 = '2022-11-23'
  param_1 = 5
)

I've tried the above and had no success - Query error: Unrecognized name: param_2 at [2:3]我已经尝试了上述方法但没有成功 - Query error: Unrecognized name: param_2 at [2:3]

Is there a way of doing what I want?有没有办法做我想做的事?

I am not sure it is possible.我不确定这是否可能。 According to documentation about procedure calling the syntax should follow:根据有关过程调用的文档,语法应遵循:

CALL procedure_name (procedure_argument[, …])

So, at this moment I don't see any permissive ways to use the argument names explicitly in the procedure call.因此,目前我看不到任何在过程调用中显式使用参数名称的许可方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM