question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntax error (missing right parenthesis) on some match-recognize expression

See original GitHub issue

Here is a query running fine in SQL Developer but failing in DBeaver with a syntax error (missing right parenthesis) when using “{- pattern -}” syntax in a match_recognize expression:

Tried with default ORACLE connection (both version 4 and latest 5.3.2 CE) and with custom one using ojdbc8.jar

WITH t AS (
 	select to_DATE( '2007-01-01', 'YYYY-MM-DD') AS start_date, to_DATE( '2007-01-15', 'YYYY-MM-DD') AS end_date FROM dual 
 	UNION all
	select to_DATE( '2007-01-03', 'YYYY-MM-DD') AS start_date, to_DATE( '2007-01-10', 'YYYY-MM-DD') AS end_date FROM dual 
 	UNION all
	select to_DATE( '2007-01-12', 'YYYY-MM-DD') AS start_date, to_DATE( '2007-01-25', 'YYYY-MM-DD') AS end_date FROM dual 
 	UNION all
	select to_DATE( '2007-01-20', 'YYYY-MM-DD') AS start_date, to_DATE( '2007-02-01', 'YYYY-MM-DD') AS end_date FROM dual 
 	UNION all
	select to_DATE( '2007-02-05', 'YYYY-MM-DD') AS start_date, to_DATE( '2007-02-10', 'YYYY-MM-DD') AS end_date FROM dual 
 	UNION all
	select to_DATE( '2007-02-05', 'YYYY-MM-DD') AS start_date, to_DATE( '2007-02-28', 'YYYY-MM-DD') AS end_date FROM dual  
 	UNION all
	select to_DATE( '2007-02-10', 'YYYY-MM-DD') AS start_date, to_DATE( '2007-02-15', 'YYYY-MM-DD') AS end_date FROM dual 
 	UNION all
	select to_DATE( '2007-03-01', 'YYYY-MM-DD') AS start_date, to_DATE( '2007-03-02' , 'YYYY-MM-DD') AS end_date FROM dual  
 	UNION all
	select to_DATE( '2007-03-03', 'YYYY-MM-DD') AS start_date, to_DATE( '2007-03-16', 'YYYY-MM-DD') AS end_date FROM dual 
)
select start_gap, end_gap from t
match_recognize(
  order by start_date
  measures max(end_date) start_gap, next(start_date) end_gap
  all rows per match
  pattern((A| {- B -} )+)
  define A as max(end_date) < next(start_date)
);

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
p3consultingcommented, Jan 14, 2019

Yes exactly that’s the “problem”, meantime you sent latest message, I tested by copying the original ORACLE connection type instead of creating one from the Generic and now it works…

Good news… thank you

So to resume, complete solution is: copy original ORACLE connection model (NOT creating one from Generic one) change the JAR for the ojdbc8 one check “Disable escaping in SQL scripts”

0reactions
serge-ridercommented, Jan 14, 2019

Ah, I see. You created custom driver using Generic provider? Then yes, this option won’t work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ORA-00907: missing right parenthesis - TekStream Solutions
Error ORA-00907 can commonly occur in commands such as CREATE TABLE, CREATE CLUSTER, and INSERT, which all require an itemized list enclosed in...
Read more >
ORA-00907: missing right parenthesis - Stack Overflow
This is one of several generic error messages which indicate our code contains one or more syntax errors. Sometimes it may mean we...
Read more >
ORA-00907: missing right parenthesis Solution - Database Star
When working with Oracle SQL, all left parenthesis (the “(” character) must be paired with a right parenthesis character (the “)” character). If ......
Read more >
SQL - Just another ORACLE Development blog
00000 - "missing right parenthesis" *Cause: *Action: Error at Line: 11 Column: ... You will also miss the RESTART option in the syntax...
Read more >
ORA-00907: missing right parenthesis tips - Burleson Consulting
The symptoms of ORA-00907 and Bug 4433936 are simple syntax errors which happen within parsing queries associated with FULL/LEFT OUTER joins.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found