You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
Exception in thread "main" net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "ON" "ON"
at line 1, column 115. System
JSQLParser does expect the extra-brackets around the nested joins, although this might be subject to a change/improvement because in fact the RDBMS do not expect these extra-brackets.
JSQLParser does not support your initial statement.
select*fromrisk.instrument a
inner joinrisk.instrument b
inner joinrisk.instrument c
onb.id_instrument=c.id_instrumentona.id_instrument=b.id_instrument
It is indeed a valid statement and we will need to refactor the JOIN expressions accordingly.
The original report is legit, thank you for reporting it.
Greetings, either pull from the PR (which has not been accepted yet) or use the attached unoffical snapshot I built for you. jsqlparser-4.2-SNAPSHOT_UNOFFICAL.jar.zip
Activity
manticore-projects commentedon Aug 14, 2021
Greetings.
unfortunately I am not sure if your Statement is valid.
Changing it into valid syntax will work:
You can test it here online and interactively
Please close the issue after verification.
longht95 commentedon Aug 14, 2021
Thanks for your support,
But this is statement is valid.
You can check it below :
sqlstatement
check valid SQL oracle :
https://www.eversql.com/sql-syntax-check-validator/
Do you have an idea for this issue?
Maybe, convert the statement to JSQLParse have to parse it.
manticore-projects commentedon Aug 14, 2021
JSQLParser does expect the extra-brackets around the nested joins, although this might be subject to a change/improvement because in fact the RDBMS do not expect these extra-brackets.
JSQLParser does not support your initial statement.
manticore-projects commentedon Aug 14, 2021
according to https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_10002.htm#BABGHCBD

my assumption on the syntax seems to be correct.
manticore-projects commentedon Aug 14, 2021
I have just checked in H2 and also Oracle itself
It is indeed a valid statement and we will need to refactor the JOIN expressions accordingly.
The original report is legit, thank you for reporting it.
longht95 commentedon Aug 14, 2021
I look forward to your updates
Implement Joins with multiple trailing ON Expressions
longht95 commentedon Sep 3, 2021
Dear @manticore-projects ,
How to get a version to have the resolver
manticore-projects commentedon Sep 4, 2021
Greetings, either pull from the PR (which has not been accepted yet) or use the attached unoffical snapshot I built for you.
jsqlparser-4.2-SNAPSHOT_UNOFFICAL.jar.zip
Implement Joins with multiple trailing ON Expressions (#1303)
fix(parser): parse INSERT ON CONFLICT after a join's trailing ON
fix(parser): parse INSERT ON CONFLICT after a join's trailing ON (#2551)