Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL deparser ?

Re: SQL deparser ?

From: Nigel Thomas <nigel_at_preferisco.com>
Date: Thu, 18 May 2006 06:30:14 -0700 (PDT)
Message-ID: <20060518133014.51253.qmail@web54705.mail.yahoo.com>


Isn't Google marvellous. There's a SQL parser at http://www.sqlparser.com/ that allegedly gives you access to the parse tree. The pretty-printing seems to work so maybe the parse tree will too. This is based on yacc. The big question will be whether the grammar is sufficient for your needs...  

Cheers Nigel

I think the best way to perform it is using a grammar parser. Otherwise you have a very, very tough project.  

I usually use "antlr" (http://www.antlr.org/). It's quite good. In the website you can find oracle grammar examples.  

HTH   On 5/18/06, Bernard Polarski <bpolarsk_at_yahoo.com> wrote: Hello lister,

I am wondering if anybody knows a resource for a procedure/program that will isolate predicates for a given SQL.

I am quite interrested in the work of Dan Tow ( http://www.oreilly.com/catalog/sqltuning/) and SQL diagramming as a generic approache to tune SQL. However this method requests for an SQL of 20 tables and 50 joins to generate counts and ratio for each predicate and it is rapidily over the hundred SQL statement.

I have made some search on the difficulty to deparse just and SQL in the oracle syntax (not even considering the SQL ANSI). Taking in account just Select, but with the inline views, union, aliases and implicit aliase - inlined views not aliases and right predicate being SQL -ie exists (select ... ) - , it is quite a big work. I estimate this to several weeks in perl and this just to isolate the predicates.

I had a look to perl module SQL::Statement::Syntax but it is quite poor.

Any hint on a resource, would be very appreciated.

B. Polarski
http://www.smenu.org  

--



Enrique
--

http://www.freelists.org/webpage/oracle-l Received on Thu May 18 2006 - 08:30:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US