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

Douglas Surber douglas.surber at oracle.com
Tue Oct 9 18:47:06 UTC 2018


Oracle Database JDBC driver from release 12c recognizes ‘{\ … \}’ as escape syntax. The character sequence between ‘{\’ and ‘\}’ is sent to the database without further processing except that any occurrence of ‘\\’ is replaced with a single ‘\’. These tokens are not recognized inside literals or comments. There is no constraint on the contained character sequence other than the requirement to double backslashes that do not terminate the sequence. In particular the character sequence can be of any length, unto and including the entire SQL text.

In 2013 when we added this to the Oracle Database JDBC driver, we thought it was the best choice available lacking consensus from the JDBC EG. We still think it is the best choice. Oracle Database JDBC must continue to support this going forward. Our preference would be for this to be added to the JDBC standard. We have no fundamental objection to additional syntax to meet specific needs. We would rather not to add both the proposed syntax and some equivalent alternate syntax as that would be unnecessary duplication. We would very much prefer that our proposed syntax be part of the standard though we will consider alternatives.

Douglas

> On Oct 9, 2018, at 11:17 AM, Mark Rotteveel <mark at lawinegevaar.nl> wrote:
> 
> On 9-10-2018 20:07, Lance Andersen wrote:
>>> 
>>> I see that that proposal contains some parts not explicitly mentioned in the current proposal (eg escaping \ within the escaped text, see below). Is that still the intent? Or did this change?
>>> 
>>> --------------------
>>> {\...\}
>>> 
>>> expands to the characters between '{\' and '\}'. Doubled backslashes '\' expand to a single backslash.
>>> 
>>> {\?\}  expands to ?
>>> {\{fn sysdate()}\} expands to {fn sysdate()} and is not further expanded
>>> {\}\} expands to }
>>> {\\\}\} expands to \}
>>> 
>>> —————————
>>> 
>> Escape processing would be disabled  for anything between the  {\…\} (or whatever it ends up being)
> 
> To be 100% clear: the original proposal from 2013 is not what's currently implemented in the Oracle JDBC driver?
> 
> That is specifically does "{\\\}\} expands to \}" no longer apply for this proposal? Would this instead yield "\\}" (as "{\\\}" yields "\" and "\}" is not an escape and thus forwarded as is?
> 
> Mark
> -- 
> Mark Rotteveel



More information about the jdbc-spec-discuss mailing list