SQL 2016 MATCH RECOGNIZE JDBC parameter Marker / Escape Characters

Mark Rotteveel mark at lawinegevaar.nl
Tue Oct 9 15:38:13 UTC 2018


On 9-10-2018 09:29, Lukas Eder wrote:
> I have two comments on this:
> 
> 1. Expecting the "unexpected", how would you go about escaping the escape
> sequence? If {\...\} is ever something we would like to send to the server
> "AS IS", without being processed, how could that be done? Another way to
> escape it could be to double it: Ordinary marker: ?, Escaped marker: ??

Given the use of {...} is a common escape (it was originally defined in 
ODBC), I don't expect it likely that a SQL dialect will have a syntax 
where {} is in the literal, but even if that was the case, it can always 
be solved by another layer of escapes.

Say there is a SQL dialect that requires {\something\} to be sent 
literally to the server, then you could fix that by using
{\{\something\\}{\}\} (that is surround {\something\ in the first escape 
and } in the second.

Ugly as hell, but it will work. Alternatively, you could disable escape 
processing (although, not all drivers have an option to disable it for 
prepared statements).

-- 
Mark Rotteveel


More information about the jdbc-spec-discuss mailing list