Advanced syntax for SQL queries
SQL Query Interpolation Syntax
This page provides an overview of SQL interpolation techniques, focusing on how to dynamically inject parameterized values into SQL queries. It explains the differences between the <%= %>
and {{ }}
syntaxes for injecting frontend and backend variables, and offers practical examples for various data types and scenarios
Variable Injection Sources
Frontend variables (set in app configuration or by requesters/filters):
Use
<%= %>
syntax
Backend variables (from instance config or user attributes):
Use
{{ }}
syntax
String or Integer Values from User/Instance Context
For string attributes:
For numeric attributes:
Checkbox Requester (Array) of Strings
Use "IN" instead of "=" and join syntax:
List of String Values from User Attributes/Instance Context
Array or List of Integers
For checkbox filter:
For user attributes:
String Template Filtering
Based on user/instance context:
Based on requester value:
List of String Templates from Checkbox Values
List of String Templates from User/Instance Context
This structure organizes the information into clear sections with appropriate headers, code blocks for SQL snippets, and consistent formatting.
Last updated