-
Notifications
You must be signed in to change notification settings - Fork 420
Variables
Rene Saarsoo edited this page Aug 9, 2022
·
12 revisions
- BigQuery: identifier syntax
- DB2: identifier syntax
-
Hive:
${hivevar:name}
,${hiveconf:name}
,${system:name}
or${name}
. These are substitution variables (as in Oracle SQL terminology). They behave more like string-interpolation, that is, the values aren't automatically escaped by the system. A common example is to place the variable inside a string:SELECT * FROM users WHERE name = '${hivevar:USER_NAME}'
. Also one can use the variable to parameterize table or column name (SELECT * FROM ${hivevar:my_table}
). See also post in StackOverflow. -
MariaDB:
@name
(where the name consists of alphanumeric characters,.
,_
, and$
),@'var name'
,@"var name"
,@`var name`
(can be quoted as string or identifier) - MySQL: Same as MariaDB
- N1QL: N/A
-
PL/SQL:
&name
or&&name
substitution variables (and:name
bind variables - see parameters). - PostgreSQL: identifier syntax (only in PL/pgSQL).
- Redshift: N/A
- SingleStoreDB:1
@name
(where the name consists of alphanumeric characters,_
, and$
),@`var name`
-
Spark:
${name}
Like with Hive, these are substitution variables. - SQLite: N/A
-
Transact-SQL:
@name
(using identifier syntax for name) - Trino: N/A
Notes:
- Tested SingleStoreDB syntax manually. Found no documentation of variable syntax.