Re: SQL deparser ?

  • From: "Enrique Fernandez-Pampillon" <oracle.pampillon@xxxxxxxxx>
  • To: bpolarsk@xxxxxxxxx
  • Date: Thu, 18 May 2006 15:08:09 +0200

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

Other related posts: