简体   繁体   中英

Getting Invalid Identifier for Snowflake Sequence Nextval

I created a Sequence batch_id_seq in Snowflake. But when I am running the query "select batch_id_seq.nextval" from outside snowflake environment, I am getting the below error:

SQL compilation error: error line 1 at position 7 invalid identifier 'BATCH_ID_SEQ.NEXTVAL'

The query is working fine from within Snowflake Worksheet. Can anyone let me know what needs to be done to resolve the issue.

Most likely you are at different schema SELECT CURRENT_SCHEMA() :

select batch_id_seq.nextval

=>

select <schema_name_here>.batch_id_seq.nextval

Kindly check if the role you are using has the proper rights and grants to be able to access the schema.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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