Description
TSynSQLSyn with SQLDialect = sqlOracle does not recognize Oracle's alternative quoting mechanism (q-quote operator), introduced in Oracle 10gR2.
The syntax uses a q or Q prefix followed by a chosen delimiter pair, allowing single quotes inside string literals without escaping:
SELECT q'[it's a string]' FROM dual -- delimiters [ ]
SELECT q'(it's a string)' FROM dual -- delimiters ( )
SELECT q'{it's a string}' FROM dual -- delimiters { }
SELECT q'<it's a string>' FROM dual -- delimiters < >
SELECT q'-it's a string-' FROM dual -- symmetric delimiter -
SELECT q'Xit's a stringX' FROM dual -- symmetric delimiter X
Current behavior
The highlighter does not recognize the q'...' literal. Everything from the opening q' onward is tokenized incorrectly (the string is not recognized as a string literal, and subsequent tokens are miscolored).
Expected behavior
When SQLDialect = sqlOracle, the highlighter should recognize q'<delim>...<closing-delim>' as a complete string token, where:
- If the opening delimiter is
[, (, {, or <, the closing delimiter is the matching ], ), }, or >
- Otherwise the closing delimiter is the same character as the opening one
- The token ends only when the closing delimiter is immediately followed by a single quote (
')
Notes
- The
q prefix is case-insensitive (q or Q)
- The delimiter can be any character except space, tab, newline, and
'
- This syntax is valid in both SQL and PL/SQL
- It has been available since Oracle 10gR2 (2005)
Example screenshots:
1. This is a screenshot of of TSynEdit displaying some SQL using this syntax:

2. This is the same SQL as highlighted by a commercial oracle-specific SQL tool which is aware of this syntax:

Description
TSynSQLSynwithSQLDialect = sqlOracledoes not recognize Oracle's alternative quoting mechanism (q-quote operator), introduced in Oracle 10gR2.The syntax uses a
qorQprefix followed by a chosen delimiter pair, allowing single quotes inside string literals without escaping:Current behavior
The highlighter does not recognize the
q'...'literal. Everything from the openingq'onward is tokenized incorrectly (the string is not recognized as a string literal, and subsequent tokens are miscolored).Expected behavior
When
SQLDialect = sqlOracle, the highlighter should recognizeq'<delim>...<closing-delim>'as a complete string token, where:[,(,{, or<, the closing delimiter is the matching],),}, or>')Notes
qprefix is case-insensitive (qorQ)'Example screenshots:
1. This is a screenshot of of TSynEdit displaying some SQL using this syntax:

2. This is the same SQL as highlighted by a commercial oracle-specific SQL tool which is aware of this syntax:
