in reply to Re^3: Parse complex SQL statement
in thread Parse complex SQL statement

Hello Kenneth, Thanks for your reply... There was a typo in my sql the successive commas shd have had "null" in between... However, this is not the issue. I have a problem with the nested queries... Also, I can't use this regexp because it's too specific and I have various sql statements with different structures...
I found a module at: https://searchcode.com/codesearch/view/836428/
This seems to be parsing fine for now ... I just need to find a way to keep the hierarchy on the nested sqls...

Replies are listed 'Best First'.
Re^5: Parse complex SQL statement
by kennethk (Abbot) on Jun 16, 2014 at 19:22 UTC
    Hierarchy is probably best maintained by anchoring front and back, and literally recursively parsing the statements.

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.