Placeholder syntax
Use$1, $2, $3, … as positional placeholders anywhere a value expression is valid in a SQL statement:
query_parameters request property. Firebolt substitutes the values server-side before executing the query.
Specifying parameters
In the SQL Workspace
Use theSET statement to define parameters before running the query:
Via the REST API
Passquery_parameters as a URL query string parameter when calling the query endpoint:
Parameter value types
A parameter’s SQL type comes from the JSON type of its value. An integer becomesINT/BIGINT, a JSON number becomes a floating-point value, a boolean becomes BOOLEAN, a string becomes TEXT, and null becomes SQL NULL. These are used directly, without a cast:
DATE, TIMESTAMP, NUMERIC/DECIMAL, BYTEA, JSON, and the BigQuery DATETIME/BYTES/NUMERIC spellings) is passed as a string and cast in the query:
JSON.
Using parametrized queries from an SDK
When connecting via an SDK or driver, parameters are set through the SDK’s prepared statement API rather than viaSET. Each SDK uses the same $1, $2, … placeholder syntax in the query string.
For implementation details across all supported SDKs and drivers, see Parametrized queries.