Re: SQL deparser ?
- From: Nigel Thomas <nigel@xxxxxxxxxxxxxx>
- To: oracle.pampillon@xxxxxxxxx, oracle-l <oracle-l@xxxxxxxxxxxxx>
- Date: Thu, 18 May 2006 06:30:14 -0700 (PDT)
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 ----- Original Message ---- From: Enrique Fernandez-Pampillon <oracle.pampillon@xxxxxxxxx> To: bpolarsk@xxxxxxxxx Cc: oracle-l@xxxxxxxxxxxxx Sent: Thursday, May 18, 2006 2:08:09 PM Subject: Re: SQL deparser ? 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@xxxxxxxxx> 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
- Re: SQL deparser ?
- From: Enrique Fernandez-Pampillon
- Re: SQL deparser ?