WRITE QUERIES

Use named SQL parameters

Add named values to saved queries and bind them in Studio or a Confluence macro.

Write named parameters

Use a colon followed by a name in SQL, such as :status or :owner_id. Simple DB detects the names in a query and asks for values when you run it.

Supply values in Studio

Enter a value for each parameter in the parameter panel before running the SQL. Parameter values are bound for that execution; the saved SQL keeps its named placeholders.

Bind values in a macro

When a saved or custom query is used as a macro source, configure a parameter as fixed to keep the chosen value with the macro, or expose it so the page reader can provide a value. Inline value macros do not expose parameters to readers.

Keep data types in mind

Parameter inputs can be collected and coerced for execution. Use a value that matches how the underlying column is stored, and test the query in Studio before publishing it on a page.