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

Douglas Surber douglas.surber at oracle.com
Wed Oct 10 14:01:10 UTC 2018


That is a character sequence literal so that is covered. Same for N’…’ literals and double quoted identifiers. I didn’t mention them in the description but should have. ‘{\’ is not recognized inside double quoted identifiers.

Douglas

> On Oct 10, 2018, at 12:24 AM, Lukas Eder <lukas.eder at gmail.com> wrote:
> 
> I've just thought of another caveat related to the Oracle database, which knows quoted string literals:
> https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/Literals.html#GUID-1824CBAA-6E16-4921-B2A6-112FB02248DA <https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/Literals.html#GUID-1824CBAA-6E16-4921-B2A6-112FB02248DA>
> 
> This is a valid string literal in Oracle:
> q'{string content here}'
> 
> This is also a valid string literal in Oracle:
> q'{\string content with some backslashes here\}'
> 
> While there shouldn't be any syntactic ambiguity, given the leading q' token, it's still a caveat worth keeping in mind.
> 
> On Wed, Oct 10, 2018 at 6:52 AM Douglas Surber <douglas.surber at oracle.com <mailto:douglas.surber at oracle.com>> wrote:
> All correct.
> 
> > On Oct 9, 2018, at 1:18 PM, Mark Rotteveel <mark at lawinegevaar.nl <mailto:mark at lawinegevaar.nl>> wrote:
> > 
> > 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