Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dtp-dev] how to use parser of datatools.

I want to use sql parser to parse a SQL script (multiple statements) then get what tables are referenced in the script.

The target database will be DB2 or MSSQL.

I found I can parse the query
QueryStatement queryStmt = parserManager.parseQuery("SELECT SUBQRY.* FROM (SELECT COL1, COL2 FROM TABLEA) AS SUBQRY");
then use
org.eclipse.datatools.modelbase.sql.query.helper.StatementHelper.getTablesForStatement
My questions:
1. How to parse multiple statements?
2. I'm using Maven for my project. Are there maven packages for datatools? 
3. Where can I find more examples about datatools?
Thanks.

Back to the top