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

Home -> Community -> Mailing Lists -> Oracle-L -> Parsing SQL Statement

Parsing SQL Statement

From: Deepak Sharma <sharmakdeep_oracle_at_yahoo.com>
Date: Wed, 21 Mar 2007 08:27:52 -0700 (PDT)
Message-ID: <20070321152752.7907.qmail@web52802.mail.re2.yahoo.com>


Is there an easy way to extract the different parts of an SQL statement (SELECT, FROM, WHERE), in order to determine the columns being used, tables being accessed and columns being used in the where clause?

For simple SQL that has only one of the above clauses, may be simple (using substr, instr etc.), but it gets complicated with inline views, sub-queries etc.

Would "Oracle Text" be of any significance here in order to do the parsing?

The idea is to use database auditing (using db,extended ) that would capture the SQL statement, but we could then parse the SQLs to see the column-access usage, table accessed in the SQL and the colums used in the where condition (this may also be present already in sys.column_usage, but I'm not sure).

Thanks,
Deepak  



Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097
--
http://www.freelists.org/webpage/oracle-l
Received on Wed Mar 21 2007 - 10:27:52 CDT

Original text of this message

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