fsdotnet

Bind Parameters

.NET & Data

runs locally

Turning a logged query and its bind values into something runnable

Application logs give you the query with :placeholders on one line and the parameter values on another. To reproduce the problem in a SQL client you have to put them back together by hand, which is tedious and easy to get wrong on the sixth parameter. This tool does the substitution and formats each value for the target dialect.

It only recognises real bind variables. A colon inside a string literal or a comment is not a bind, and neither is the :mi in a format mask — TO_CHAR(tarih, 'HH24:MI') contains no parameter, though a naive parser sees one. Oracle itself makes the opposite mistake and raises ORA-01745 when a genuine bind is named like a reserved word.

The output is for debugging only. Keep the binds in production code: substituting values into SQL text is how injection happens, and it also throws away the shared cursor, so every call reparses.

How are dates handled?

A date-only value becomes DATE '2026-08-24' and a value with a time becomes TO_DATE with an explicit format mask, so the result does not depend on the session NLS_DATE_FORMAT.

What is ORA-01745?

"Invalid host/bind variable name". Usually a bind named after a reserved word, or a colon that Oracle read as a bind when you meant a literal — the :mi case above is the classic one.