且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在bigquery查询中设置命名参数

更新时间:2022-11-27 11:12:42

只有通过API使用标准SQL ,而不是Web UI。您可以在运行参数化查询一节中阅读它们。如果您对查询参数的Web UI支持感兴趣,则可以为问题跟踪器。


I am trying to use named parameters in my query on bigquery.

@val '123';
SELECT *
FROM [project_id:my_dataset.my_table] 
where name=@val

I get

Encountered " <MAX_TOKEN_VAL> "R "" at line 1, column 2. Was expecting: <EOF>

is there any way to set named parameters on biquery?

Named parameters are supported in BigQuery only through the API using standard SQL, not the web UI. You can read about them in the section on Running parameterized queries. If you are interested in web UI support for query parameters, you can star the feature request on the issue tracker.