• Post Reply Bookmark Topic Watch Topic
  • New Topic

Converting SQL to Excel formulas  RSS feed

Jayesh A Lalwani
Posts: 2762
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have crossposted this on the antlr-discussion google group because Antlr is a solution I am exploring

'm trying to build something that can parse a where clause and convert it into an Excel formula. The Excel sheet has named cells corresponding to the database columns. So, I want to be able to do something like parse a where clause "ColA > 20 and ColB='XXX'" into "=AND(ColA>20,ColB="XXX")". Or alternatively, if there is something that can parse the SQL where clause and give me an expression tree, I can do my thing right in Java, and I don;t really need to generate an Excel formula.

Anyone know if there is a OTS solution for this?

I was looking at ANTLR and someone mentioned that ANTLR already has the grammar for ANSI SQL. I couldn;t find it because I guess ANTLRv4 just got released and their documentation hasn't caught up yet. I don't need a full SQL parser, just the Where clause. So, it should be a much simpler grammar.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!