FORMAT(...)

All functions > STRING > FORMAT(...)

Builds a VARCHAR from a C-style format string and one scalar argument per placeholder.

Syntax

FORMAT(format, value, value, …)  ·  PRINTF(format, value, value, …)

Notes

  • FORMAT(...) is the canonical spelling; PRINTF(...) is an equivalent alias
  • The template uses C-style placeholders (for example %s); pass one scalar per placeholder in order
  • Mix scalar types in the value list as needed; cast when the template requires a specific shape
  • If any substituted value is NULL, the result is typically NULL—use COALESCE when you need a fallback

Related Functions

Examples

FORMAT(...)

FeatureQL
SELECT
    f1 := FORMAT('Hello %s', 'World'), -- Single %s placeholder
    f2 := FORMAT('Order %s for %s', 'A-1', 'Alice') -- Two placeholders
;
Result
f1 VARCHARf2 VARCHAR
Hello WorldOrder A-1 for Alice

PRINTF(...) — alias

FeatureQL
SELECT
    f1 := PRINTF('x=%s y=%s', '1', '2') -- Same behavior as FORMAT(...)
;
Result
f1 VARCHAR
x=1 y=2

Last update at: 2026/05/26 17:22:09