- 1 Minute to read
Snowflake Reserved Words Support
- 1 Minute to read
One of the key features of Snowflake is its support for SQL queries, which enables users to manipulate data using a familiar syntax.
However, as with any SQL-based platform, there are certain reserved words that cannot be used as identifiers in queries. This can sometimes cause confusion or errors when working with Snowflake.
This document provides an overview of the reserved words in Snowflake as a Target and how they are handled by Rivery.
Snowflake Reserved Words
Snowflake has a large number of reserved words that are not available for use as identifiers in SQL queries. These words are reserved because they have a specific meaning within the SQL language and are used by Snowflake to parse and execute queries correctly.
The full list of Snowflake reserved words can be found in the Snowflake documentation.
Some examples include:
Handling Reserved Words in Snowflake
When working with Snowflake, it is important to avoid using reserved words as identifiers in SQL queries. If a reserved word is used as an identifier, it can cause errors or unexpected behavior in the query.
To avoid these issues, Rivery provides a technique for handling reserved words:
One way to handle reserved words in Snowflake is to enclose them in double quotes (""). This tells Snowflake to treat the enclosed text as an identifier, rather than a reserved word.
For example, if you wanted to create a table with the name select, you could enclose the name in double quotes like this:
CREATE TABLE "select" (id INT, name VARCHAR);
In the above SQL statement, we have enclosed the reserved word select in double quotes. Now, Snowflake will treat select as an identifier rather than a reserved word and will perform the operation on the select table.
In case you fail to avoid using reserved words, Rivery will generate an error indicating that the reserved word cannot be used as an identifier.