Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » BadParseException in mysql db(BadParseException in mysql db)
BadParseException in mysql db [message #669724] Wed, 11 May 2011 09:34
Woo  is currently offline Woo
Messages: 3
Registered: August 2010
Junior Member
I want to parse mysql sql content using dtp sql parser.
I don't know invoking(or creating) mysql dialect sql parser, I invoked generic sql parser and parse sql content
so it occured BadParseException.

code:
String sql = "select max(cast(emp_no as unsigned)) from emp limit 5"; // error issue is 'limit 5'
SQLQueryParserManager parserManager = SQLQueryParserManagerProvider.getInstance().getParserManager (null, null); // <- mysql, version 5
SQLQueryParseResult queryParseResult = parserManager.parseQuery(sql);
...

error:
org.eclipse.datatools.sqltools.parsers.sql.SQLParserExceptio n: Unable to parse the input: "select max(cast(emp_no as unsigned)) from emp limit 5;".
at org.eclipse.datatools.sqltools.parsers.sql.AbstractSQLParser .parser(AbstractSQLParser.java:414)
at org.eclipse.datatools.sqltools.parsers.sql.SQLParserManager. makeAST(SQLParserManager.java:436)
at org.eclipse.datatools.sqltools.parsers.sql.SQLParserManager. parse(SQLParserManager.java:791)
at org.eclipse.datatools.sqltools.parsers.sql.query.SQLQueryPar serManager.parseQuery(SQLQueryParserManager.java:326)
...
Caused by: lpg.lpgjavaruntime.BadParseException
at lpg.lpgjavaruntime.BacktrackingParser.parse(BacktrackingPars er.java:142)
at lpg.lpgjavaruntime.BacktrackingParser.parse(BacktrackingPars er.java:100)
at org.eclipse.datatools.sqltools.parsers.sql.AbstractSQLParser .parser(AbstractSQLParser.java:384)
... 32 more

Parsing target db is mysql, version is 5.0
How to invoking(or create) mysql dialect sql parser, is there plugins or jar file needed
Previous Topic:Can't browse schemas
Next Topic:Sybase "create procedure" scripts
Goto Forum:
  


Current Time: Fri Sep 19 10:00:31 GMT 2014

Powered by FUDForum. Page generated in 0.02947 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software