-2

I have multiple SQL queries (SELECT statements using FROM and WHERE - standard), and was looking for a parser in which I can feed in SQL queries as text and gives out the column names being used and corresponding table and schema names. Parser should take care of aliases and joins to notice distinct column names that are being used.

Please give me ideas to use a java library and also an exel API because the queries are in EXCEL cell. Would be great if to get something. Thanks

I would code an SQL parser but don't want to reinvent the wheel and not confident that I could make it work completely. Thanks for your input.

Please let me know if you know of parsers in other languages that would work. Thanks

tzharg
  • 313
  • 2
  • 11

1 Answers1

0

I had to do some SQL parsing a short while ago. I used GSP: http://www.sqlparser.com/

It's closed source and not free so GSP might not be an option for you. I wasn't able to find a free SQL Parser for Teradata so GSP was my best option. If you decide to go with GSP, the Java docs aren't that great. Your best bet is to find example code from the examples section on their website and work from there.

Apache POI is a good API for excel: http://poi.apache.org/