perl_help26 has asked for the wisdom of the Perl Monks concerning the following question:
Suppose I have a complex sql statement STRING such as:
"INSERT INTO TABLE1 ( PARAM1, PARAM2, PARAM3, PARAM4 , PARAM5, PAR +AM6 ,PARAM7) values (SELECT nextval('SEQ_TABLE1') , 9613000001 , 1 ,null , PARAM +8 , 1234 , localtimestamp FROM TABLE2 , TABLE3 WHERE TABLE2.PARAM1= TABLE3.PARAM2 AND TABLE2.PARAM3 = 1)"
I would like to parse it somehow to get the parameters mappings such as :
PARAM1=>SELECT nextval('SEQ_TABLE1')
PARAM2=>9613000001 etc...
Is there a good parser module ?? I didn't find a module that really pulls it off.
If not, could we somehow parse it on the SQL level?
Thanksss..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse complex SQL statement
by roboticus (Chancellor) on Jun 11, 2014 at 15:54 UTC | |
by perl_help26 (Beadle) on Jun 12, 2014 at 06:08 UTC | |
|
Re: Parse complex SQL statement
by kennethk (Abbot) on Jun 11, 2014 at 15:57 UTC | |
by perl_help26 (Beadle) on Jun 12, 2014 at 06:09 UTC | |
by kennethk (Abbot) on Jun 12, 2014 at 15:04 UTC | |
by perl_help26 (Beadle) on Jun 16, 2014 at 09:29 UTC | |
by kennethk (Abbot) on Jun 16, 2014 at 19:22 UTC |