real.aussie has asked for the wisdom of the Perl Monks concerning the following question:
I have a requirement to parse a string with resursive statements. It happens to be SQL, but not sure that matters directly. I need to turn each field into field format \"%s|\". That is convert:
into"select A, B, C, (select D, E, F, (select G, H from AA where ID = Z) from BB where ID2 = X), I, J from CC;"
You can see that when I find a second "select" I have to go down a level to find each of the fields D thru F, then again for G & H. Then pop back out to finish I & J. And I'm not too sure how to go about it."select A format \"%s|\", B format \"%s|\", C format \"%s|\", (select D format \"%s|\", E format \"%s|\", F format \"%s|\", (select G format \"%s|\", H format \"%s|\" from AA where ID = Z) f +rom BB where ID2 = X), I format \"%s|\", J format \"%s|\" from CC;"
Alf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Recursive parse -
by GrandFather (Saint) on Aug 19, 2011 at 11:46 UTC | |
|
Re: Recursive parse -
by Anonymous Monk on Aug 19, 2011 at 01:39 UTC | |
|
Re: Recursive parse -
by tybalt89 (Monsignor) on Nov 05, 2024 at 22:58 UTC |