SQL Parser

Database
Enthusiast

SQL Parser

For Meta Data Management reasons we’re looking for a java sql parser.
The goal is to find a JAVA class where you can pass your sequel.
As result we want to know the tables used by the query.
In a later phase the columns become also important.

Who is already doing this?
What is the software you’re using.
Who had good results with java code he is using?

Thanks for the information.

: I don’t want to use the Teradata parser (eg. with explain). Some scripts are using volatile and temporary tables.
3 REPLIES
Enthusiast

Re: SQL Parser

Hi,

We have a requirement where I need to find what percentage of queries are querying recent data vs the percentage of queries that are querying historical data.

I went on google to find any sqlparser or some UDF that I can use with terdaata to extract out the where clause of every query in a format of "name=value" pairs that I can further use to get data for my requirement.

I found one parser at sqlparser.com but it doesn't seem to be working.

Do you know of any UDF/SQL parser that works with teradata?

Is anyone else doing this kind of anlaytics on sqltextinfo column of dbc.dbqlsqltbl?

Regards,

Suhail

Enthusiast

Re: SQL Parser

Suhail,

It would be easier to export the required columns from dbc.dbqlsqltbl into a file; and then use grep /awk in Unix to extract in the required format.

Enthusiast

Re: SQL Parser

It will be a very complex awk command. There are several types of complex queries and the where clause can be anywhere. Not sure if this is an ideal solution to achieve what I need.

Plus we certainly want to build further on these kinds of analytics and make it a generic utility.

Anyone else has done this before?

-Suhail