Alternative String Literals
It is possible to use a character, or character pair, other than the doubled (escaped) apostrophe, to embed a quoted string inside another string without the need to escape the quote.The keyword q
or Q
preceding a quoted string informs the parser that certain left-right pairs or pairs of identical characters within the string are the delimiters of the embedded string literal.
<alternative string literal> ::= { q | Q } <quote> <start char> [<char> ...] <end char> <quote>
Note
|
Rules
When Inside the string, i.e. |
select q'{abc{def}ghi}' from rdb$database; -- result: abc{def}ghi
select q'!That's a string!' from rdb$database; -- result: That's a string