Re: SQL query parser
- From: Dyreatnews@xxxxxxx
- Date: Fri, 30 Nov 2007 19:19:39 +0100
Boris Stumm <stumm@xxxxxxxxxxxxxxxxxxxx> writes:
Hello all,
I am currently looking for an SQL parser written in Java, preferably
with source code. What I want to do is to infer (as far as possible)
the schema from an SQL DML statement. The parser should give me some
nice, traversable Java object tree/abstract syntax tree.
So far I only found sql4j and Zql, which both are very old and do not
parse my statements.
Anyone can give me some pointers? Here is a list of things that the
parser should be able to parse:
* CASE statements in the SELECT as well as in the WHERE clause
* subselects, exists, not exists, ...
* column and table aliasing
* grouping and aggregate functions
Derby uses javacc with an SQL grammar file which you could look at.
See http://db.apache.org/derby/dev/derby_source.html
You'll probably have to do quite a bit of tweaking to make it suit
your needs, though...
--
dt
.
- References:
- SQL query parser
- From: Boris Stumm
- SQL query parser
- Prev by Date: SQL query parser
- Next by Date: iis -> php -> odbc -> mssql timeout
- Previous by thread: SQL query parser
- Next by thread: iis -> php -> odbc -> mssql timeout
- Index(es):
Relevant Pages
|
|