The following query is correct in Oracle 12c:
SELECT *
FROM dual
MATCH_RECOGNIZE (
MEASURES a.dummy AS dummy
PATTERN (a?)
DEFINE a AS (1 = 1)
)
But it doesn't work through JDBC because of the ?
character that is used as a regular expression character, not as a bind variable.
What's the correct way to escape the ?
through JDBC, assuming I want to run this as a PreparedStatement
with bind variables?
Note:
- I've found a discussion on the JDBC spec discuss mailing list, but there's no conclusion to this problem: http://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/2013-October/000066.html
- PostgreSQL has similar problems with JSON operators: How do I use PostgreSQL JSON(B) operators containing a question mark "?" via JDBC