Hi,
Felipe Maribel wrote:
I have installed this application to parse SQL queries, but it doesn't
work with the query I try to, it is to say, the parser doesn't match the
query I send it. That is because my query has sentences like
'mydb.dbo.mytable'
The parser currently won't break on foo.bar syntax but (if I'm
remembering correctly) can't handle foo.bar.baz, that wouldn't be too
hard to add.
or "case when" in SELECT clause, etc. Besides the
Sorry, the parser does not handle CASE statements and they would not be
easy to add (though patches and collaborators are always welcome).
queries I want to parse don't have always the reserved words in capital
letters.
Identifier case is insensitive - in other words it doesn't matter if the
reserved words are in capital letters.
For Data Definition Language (DDL), you should check out
SQL::Translator, it is much more complete for DDL. It doesn't, at least
the last time I checked, handle Data Modification.
At the moment your best option may be wrapping the parsing in an eval
and creating two output files - one of successfully parsed statements
and one of statements that couldn't be parsed. (Though depending on
what you are trying to do, this may not be useful)
You may also want to look at some non-Perl SQL parsers such as the one
by Mimer. Sorry I can't be more helpful, good luck.
--
Jeff
P.S. Since this isn't strictly DBI, perhaps you should send your reply
to me directly.