我可以将SnowSight过滤器用作雪花存储过程的参数吗?
还可以使用SnowSight过滤器做任何事情
:= :MyFilter
除了从字面上看,除了我发现这非常有限之外,
...例如,许多开发人员将需要使用存储的过程和用户定义的功能,而不是Adhoc SQL ... 在这种情况下,人们想这样做,
call MyDb.MySchema.MyProc(:MyFilter);
我发现我可以在工作表中使用它,
SET MyVar = :Filter
call MyDb.MySchema.MyProc($MyVar);
然后如果在仪表板中使用,我必须将其变成SQL脚本块...但是我不设法获得 错误
DECLARE
MyVar STRING;
BEGIN
SET MyVar = :MyFilter;
CALL MyDb.MySchema.MyProc(:MyVar);
END;
我有 错误:无效的标识符'myfilter'
我错过了一个技巧吗?
我的目标是从存储过程而不是ADHOC代码驾驶仪表板,因此我可以使用源控制...
Is it possible to do anything with Snowsight filters other than literally
:= :MyFilter
I find this EXTREMELY limited...
For instance, many developers will want to use stored procedures and user defined functions rather than adhoc SQL...
In which case, one would want to do this instead
call MyDb.MySchema.MyProc(:MyFilter);
I have found I can use this in a worksheet
SET MyVar = :Filter
call MyDb.MySchema.MyProc($MyVar);
and then I would have to turn this into a SQL Scripting block if using in a Dashboard... but I don't manage to get it working
DECLARE
MyVar STRING;
BEGIN
SET MyVar = :MyFilter;
CALL MyDb.MySchema.MyProc(:MyVar);
END;
I get an error
Error: invalid identifier 'MyFilter'
Am I missing a trick?
My goal is to drive Dashboards from Stored procedures rather than adhoc code, hence I can use Source Control...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果使用经典控制台,请使用以下代码,
如果使用Snowsight
If you using Classic Console then use following code
If you using SnowSight