FAQ
Hello Jeff,



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' or "case when" in SELECT clause, etc. Besides the
queries I want to parse don't have always the reserved words in capital
letters. Is there something that I can do to solve this, the idea is to
use de SQL Standard 92. I don't have a lot of experience with Perl, so
I'm a little lost.



Thank you very much for your time.

Maribel.



************************************ DISCLAIMER *****************************************

This message is intended exclusively for the named person. It may contain confidential,
propietary or legally privileged information No confidentiality or privilege is waived
or lost by any mistransmission. If you receive this message in error, please immediately
delete it and all copies of it from your system, destroy any hard copies of it and notify
the sender. Your must not, directly or indirectly, use, disclose, distribute, print, or
copy any part of this message if you are not the intended recipient. Any views expressed
in this message are those of the individual sender, except where the message states
otherwise and the sender is authorised to state them to be the views of BBVA Suiza.
Please note that internet e-mail neither guarantees the confidentiality nor the proper
receipt of the message sent. If the addressee of this message does not consent to
the use of internet e-mail, please communicate it to us immediately.

Search Discussions

  • Jeff Zucker at Jun 25, 2007 at 3:57 pm
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedJun 25, '07 at 9:23a
activeJun 25, '07 at 3:57p
posts2
users2
websitedbi.perl.org

2 users in discussion

Jeff Zucker: 1 post Felipe Maribel: 1 post

People

Translate

site design / logo © 2022 Grokbase