SQL Placeholder Converter
Convert question-mark SQL bind placeholders to PostgreSQL $1 parameters, or back to ? with a parameter-order report.
Start with your input
Edit the example or replace it with your own text.
Choose your options
These settings are optional. Keep the defaults to get started.
How to use SQL Placeholder Converter
- Load the included example or provide your own input and settings.
- Choose the operation and review the supported format below.
- Run the tool, inspect the result, and copy or download it.
Convert prepared-statement placeholders
Use a prepared-statement SQL template to switch between anonymous question-mark parameters and PostgreSQL numbered parameters. Quoted strings, quoted identifiers, line comments, nested block comments and dollar-quoted strings are preserved. In the reverse direction the report includes an occurrence-based parameter order, so a repeated or out-of-order numbered parameter can be bound correctly by an anonymous-placeholder driver.
Keep binding separate from SQL text
This utility never substitutes values or executes SQL. Bind parameters through the receiving database driver after converting the template. SQL dialects disagree about quoting and operators; standalone PostgreSQL question-mark JSON operators cannot be distinguished from anonymous placeholders and must not be used as source placeholders. Question-mark pipe and ampersand operators are rejected. Review the output and its parameter order before changing an application query.
Example input
SELECT * FROM users WHERE email = ? AND active = ? AND note <> '?';
Does SQL Placeholder Converter upload my input?
No. This tool processes input locally in your browser without calling a conversion API.
Is input uploaded?
Processing takes place in your browser. This tool does not send your input or selected files to a conversion API.