Skip to content

Main content

SQL Numbered Placeholder Rebase

Rebase explicit numbered SQL placeholder occurrences by a signed integer offset, rejecting invalid resulting indexes; no SQL text rewriting.

Loading tool…

Description

Rebase explicit numbered SQL placeholder occurrences by a signed integer offset, rejecting invalid resulting indexes; no SQL text rewriting.

SQL identifiers, string literals and parameter placeholders serve different roles. Quote doubling can encode a single token in a selected dialect, while binding indexes connect placeholders to supplied values. These tools work with explicit tokens or lists; they do not connect to a database or parse an entire SQL program.

Rebase explicit numbered SQL placeholder occurrences by a signed integer offset, rejecting invalid resulting indexes; no SQL text rewriting.

When to use this tool

Use this tool to rebase explicit numbered SQL placeholder occurrences by a signed integer offset, rejecting invalid resulting indexes; no SQL text rewriting.

How to use the tool and how it works

  1. Enter indexes, offset using the field definitions below.
  2. Run the operation. Correct input errors before interpreting an output.
  3. Read result.indexes. Use the ordering, boundary rules and absence conditions described below.

Add the signed offset to each validated one-based index, rejecting a result outside 1 through one million.1

Input fieldMeaning and unitsAccepted input
indexesOne-based placeholder indexes; positions of list entries remain zero-based.Dense list of at most 128 finite numbers; integer/shape constraints above also apply.
offsetSigned integer amount added to each one-based placeholder index.A finite safe integer within the operation’s stated bounds.
Output fieldInterpretation
resultObject containing the named fields below.
result.indexesRebased one-based placeholder indexes in original order.
json
{
  "input": {
    "indexes": [
      1,
      3,
      3
    ],
    "offset": 2
  },
  "output": {
    "result": {
      "indexes": [
        3,
        5,
        5
      ]
    }
  }
}

Limitations and assumptions

  • This changes a supplied index list without rewriting or parsing SQL text.
  • Placeholder indexes are one-based when stated; occurrence positions and binding-list positions are zero-based. Supported quote styles are explicit local conventions rather than a promise of compatibility with every database dialect.
  • Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
  • Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.

Alternative or Complementary methods

Use the database driver’s parameter binding for values and the target dialect’s identifier rules for names. Token formatting and occurrence audits are separate from execution, authorization and complete query validation.

References

  1. Tool behavior and example: SQL Numbered Placeholder Rebase — tool.io

Similar or alternative tools

  • SQL Numbered Placeholder Formatter

    Format a positive PostgreSQL-style numbered SQL placeholder token; no binding, query parsing or database access.

  • SQL Numbered Placeholder Gap Audit

    Audit gaps in explicit numbered SQL placeholder occurrences from one through the observed maximum; bounded to 128, no SQL lexer or parameter-count assumption.