Skip to content
Advertisement

Unable to find error in the query – Snowflake

Error: SQL compilation error: error line 105 at position 8 invalid identifier ‘INTENT’. There are two CTE’s, and then the select statement. First CTE works fine if run separately, the error is in the second CTE. I am not sure what is causing the syntax error.

Thanks in advance.

Advertisement

Answer

Snowflake treats unquoted identifiers as if they were uppercase. While quoted identifiers are case-sensitive. So you might need to specify your column alias as "INTENT" (all caps) to later refer to it without quotes.

This behavior can be changed with QUOTED_IDENTIFIERS_IGNORE_CASE should you need it.

QUOTED_IDENTIFIERS_IGNORE_CASE:

Specifies whether letters in double-quoted object identifiers are stored and resolved as uppercase letters. By default, Snowflake preserves the case of alphabetic characters when storing and resolving double-quoted identifiers. (See Identifier Resolution.) You can use this parameter in situations in which third-party applications always use double quotes around identifiers.
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement