• Post Reply Bookmark Topic Watch Topic
  • New Topic

Extract sql

 
yusuf Kaplan
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

is there a tool which can parse a sql an delivers everything after select, from and where, like for example getFrom().
Actually it should not parse for correct syntax. Just return getFrom(), getWhere(), getSelect().
Background information: I want to provide either jpql or sql to parse and am only interesting in the string after select, from, where.


Regards,
Yusuf
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried Zql in the past before and it can parse, but understanding the results is a bit tricky. The entry point is ZqlParser. It's readStatement method returns a ZStatement which is a ZQuery for SELECT statements. From this you get the various parts. This is the tricky part, especially as your queries get complex.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!