雪花仪表板瓷砖中使用的SQL的限制
我们正在尝试在雪花仪表板瓷砖中使用多语句,并且不太了解这种行为。
假设我会在瓷砖中创建这两个语句,
SET MyVar = ( SELECT TOP 1 TABLE_NAME FROM DEV_CONTROL.INFORMATION_SCHEMA.TABLES WHERE NOT TABLE_NAME = :Subscription );
SELECT $MyVar;
如果我突出显示第一行并运行它,我将获得一个成功的语句,这些声明不会返回任何内容。 如果我回到瓷砖上,我会看到“成功执行的声明”。
如果我返回我的SQL语句并突出显示两者,然后运行它,我会得到第一张表的名称。 回到仪表板,我现在看到了第二个语句的结果,即我的表名。
我发现这既令人困惑又不连贯...
瓷砖中显示的数据应该反映我输入的所有代码,而不仅仅是我碰巧的是我上次查看代码时运行的内容?
We are trying to use multi statements in Snowflake Dashboard tiles and do not quite understand the behaviour.
Let's say I create these 2 statements in my tile
SET MyVar = ( SELECT TOP 1 TABLE_NAME FROM DEV_CONTROL.INFORMATION_SCHEMA.TABLES WHERE NOT TABLE_NAME = :Subscription );
SELECT $MyVar;
If I highlight the first line and run it, I get a successful statement that does not return anything.
If I get back to my tile, I see "Statement executed successfully."
If I then go back to my SQL statements and highlights both, then run it, I get the name of the first table.
Going back to my dashboard, I now see the result of the second statement, my table name.
I find this both confusing and incoherent...
The data showed in the tile should reflect ALL the code I entered, not just what I happened to highlight and run the last time I looked at the code?...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,它没有得到很好的记录。正如您提到的那样,瓷砖仅显示上次执行查询的结果 - 至少这是我在测试中观察到的。
在这里使用雪花脚本可能会很有帮助:
以上代码将作为块执行。
Unfortunately, it's not documented well. As you mentioned, the tiles show only the result of the last executed query - at least this is what I observed on my tests.
Using Snowflake Scripting can be helpful here:
The above code will be executed as a block.