[jsr-221-eg] SQL 2016 MATCH RECOGNIZE JDBC parameter Marker / Escape Characters

Mark Rotteveel mark at lawinegevaar.nl
Tue Oct 9 20:18:32 UTC 2018


On 9-10-2018 21:50, Douglas Surber wrote:
> Mark,
> 
> The Oracle Database Driver uses the first interpretation, any occurrence of ‘/‘ must be doubled except for the single ‘/‘ that precedes the ‘}’ that ends the escape sequence. Your formal definition is correct modulo character sequence literals and comments.

Ok, rephrasing to check if we're on the same page:

Within {\..\}, occurrences of `\` must be doubled to `\\` except if 
contained in string literals or comments.

Some examples:

1. `{\'literal with {\..\}'\}` => `'literal with {\..\}'`
2. `{\something -- comment with {\..\} + linebreak
something \\ else\}`
=>
`something -- comment with {\..\} + linebreak
something \ else`
3. `{\/*comment {\..\}*/\} => /*comment {\..\}*/
4. `{\q'{\abc\}'\}` => q'{\abc\}'`
5. `{\{\\inception\\}\}` => `{\inception\}`

While `{\x \ y\}` would be a syntax error and should be `{\x \\ y\}`.
-- 
Mark Rotteveel


More information about the jdbc-spec-discuss mailing list