在Snowflake环境中运行时,获取Snowflake Sequence Nextval时出现无效标识符错误。

huangapple go评论121阅读模式
英文:

Getting Invalid Identifier for Snowflake Sequence Nextval when running in snowflake environment

问题

我在Snowflake中创建了一个名为SEQ_AUTHOR_ID的序列。当我在Snowflake环境中运行查询"select SEQ_AUTHOR_ID.nextval"时,我已经在"LIBRARY_CARD_CATALOG.Public"环境中创建了它,并在同一环境中运行查询。代码:"SELECT SEQ_AUTHOR_ID.nextval;" 我得到以下错误:无效的标识符'SEQ_AUTHOR_ID.NEXTVAL'。

我想要解决这个错误,我尝试在相同的环境中运行,但问题没有解决。

英文:

I created a Sequence SEQ_AUTHOR_ID in Snowflake. when I am running the query "select SEQ_AUTHOR_ID.nextval" in the snowflake environment,I had created it in the environment "LIBRARY_CARD_CATALOG.Public" and running the query in same environment. CODE:"SELECT SEQ_AUTHOR_ID.nextval;" I am getting the below Error: invalid identifier 'SEQ_AUTHOR_ID.NEXTVAL'

I want to resolve the Error I tried to run in same Environment but it is not resolved.

答案1

得分: 1

请确保您在窗口中选择了相同的数据库。或者尝试使用绝对数据库和模式名称以及序列运行。我尝试了所有选项,在我的情况下它可以工作。

SELECT LIBRARY_CARD_CATALOG.Public.SEQ_AUTHOR_ID.NEXTVAL
英文:

Please make sure that you have selected the same database in your window. Or try to run with absolute database and Schema name along with the sequence. I tried all the options and it works in my case.

SELECT LIBRARY_CARD_CATALOG.Public.SEQ_AUTHOR_ID.NEXTVAL

huangapple
  • 本文由 发表于 2023年3月7日 12:26:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/75658034.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定