Re: parsing SQL statement
On Fri, 2008-05-30 at 19:24 +0700, beast wrote:
Anyone having suggestion parsing SQL statement?
It should able to parse:
BLA BALA BALA...
VALUES(
'abcd efg',,999, 'some \"STRING\" and \'STR2\' STR3',,,, 'abcd, def, fghi'
)
I'm using tr and then split by "," but it will fall when seeing comma
inside the single quote.
I'm actually about to look into a SQL parsing solution myself. There
appear to be several modules on CPAN which should be at least a good
place to start.
Thanks.
--budhi
.
Relevant Pages
- Re: lexical ambiguity
... have seen quick and dirty Ada lexers that try to determine if a single quote starts a character literal by looking ahead 2 character. ... A character literal can't follow an identifier, so this must be either an attribute or a qualified expression. ... You still have an evil mind, since you didn't include any spaces between the components of the aggregate, making it even harder for humans to parse. ... (comp.lang.ada) - Re: lexical ambiguity
... have seen quick and dirty Ada lexers that try to determine if a single quote starts a character literal by looking ahead 2 character. ... A character literal can't follow an identifier, so this must be either an attribute or a qualified expression. ... I'm not sure how to parse "...", ... As you and other posters have pointed out, if we simply keep track of the last token, we can use that information to determine how to handle the single quote. ... (comp.lang.ada) - parsing SQL statement
... Anyone having suggestion parsing SQL statement? ... It should able to parse: ... BLA BALA BALA... ... (perl.beginners) - Re: parse_str and " problems
... i can i parse the data and get ... but the function parse_str replacesthe single quote ' with \' ... basically i do not want parse to add anything around the string. ... (alt.php) |
|