Informix Error -282
-282 Found a quote for which there is no matching quote.
Inspect the current statement, examining the punctuation of all quoted strings. To include the quote character in a literal string, use single apostrophes as string delimiters, as in the following example:
SELECT '"', fname,'"', "''", lname, "''" FROM customer
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-282 is a direct punctuation error: a quote character without its matching close. The official guidance also demonstrates a genuinely useful technique for a related problem — how to embed a quote character inside a literal without triggering this error.
- A missing closing (or opening) quote in a string literal — the direct, most common cause.
- Attempting to embed a quote character inside a string delimited by the same quote type, without using the correct technique — a stray, unescaped quote character inside a same-delimited string reads as an early close, leaving the rest of the intended string unmatched.
- Confusion between single-quote string literals and double-quote delimited identifiers —
especially relevant if
DELIMIDENTis set (see -201), where double quotes take on a different meaning entirely.
Solutions / Resolution
- Inspect the statement's quote punctuation carefully, per the official guidance.
- To include a quote character inside a literal, switch delimiter type rather than trying to
escape it awkwardly. The official example demonstrates this directly:
Here,SELECT '"', fname, '"', "''", lname, "''" FROM customer;'"'is a single-quote-delimited string containing one literal double-quote character, and"''"is a double-quote-delimited string containing two literal apostrophe characters — each uses the other quote type as the delimiter specifically so the embedded character doesn't need escaping.
Examples
The direct cause: a missing closing quote
SELECT * FROM customer WHERE name = 'Jane Doe;
-- -282: the opening quote before "Jane Doe" has no matching close
Fix:
SELECT * FROM customer WHERE name = 'Jane Doe';
Embedding a literal apostrophe using the delimiter-switch technique
-- Want to select the literal text: O'Brien
SELECT "O'Brien" FROM customer;
-- using double quotes as the delimiter avoids needing to escape
-- the apostrophe inside the string
The official example, explained
SELECT '"', fname, '"', "''", lname, "''" FROM customer;
This produces, for each row: a literal double-quote, the value of fname, another literal
double-quote, two literal apostrophes, the value of lname, and two more literal apostrophes —
useful for building a specific quoted/delimited output format directly in the select list.
Diagnostic Checks
- Count quote characters in the statement to find a mismatched pair.
- Check for an attempt to embed a quote character without switching to the other delimiter type.
Related Errors / Related Topics
- -201 — "A syntax error has occurred." The general punctuation-error family this belongs to.
- -280 — "A quoted string exceeds 256 bytes." Another quote-related condition, often caused by the same class of missing-quote mistake merging two strings together.
To embed a quote character inside a literal, switch to the other quote type as the delimiter — that's the standard technique, not escaping the character in place.