[jsr-221-eg] SQL 2016 MATCH RECOGNIZE JDBC parameter Marker / Escape Characters
Douglas Surber
douglas.surber at oracle.com
Tue Oct 9 15:50:39 UTC 2018
The wider scope Mark suggests is included in the proposal, or at least that is the intent. If the language is not clear we should fix it. As I wrote in a previous email
> PATTERN(A{\?\} X{\*?\} Y{\+?\} Z{\??\})
would be written as
“{\\PATTERN(A? X*? Y+? Z??)\\}”
When used in this wider scope I don’t find the doubled backslashes at all objectionable. I rather like it because it makes the escape tokens more visually apparent. And again Java developers are used to ‘\’ as an escape token so the meaning should not be surprising.
Given the wide use of single quotes in SQL I would be concerned that a developer would have a hard time with {‘ . . . ‘}. It is not nearly as easy to recognize. This syntax would be obvious to LISPers, but I don’t think it is as unsurprising to Java developers as the proposed syntax.
As I noted in my previous email ‘{q’ and ‘{quote’ are unfortunately valid SQL.
“ . . . {quote {quote}} . . .”
does look a bit confusing though admittedly it is the worst case and is unlikely.
Douglas
> On Oct 9, 2018, at 8:27 AM, Mark Rotteveel <mark at lawinegevaar.nl> wrote:
>
> Irrespective of the syntax chosen, I think it should be possible (and advisable) to widen the scope. That is, instead of
>
> PATTERN(A{\?\} X{\*?\} Y{\+?\} Z{\??\})
>
> You would use:
>
> PATTERN({`A? X*? Y+? Z??`})
>
> or maybe even
>
> {`PATTERN(A? X*? Y+? Z??)`}
More information about the jdbc-spec-discuss
mailing list