Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> list tables & columns used to satisfy query
I need an easy way to identify which of several hundred reports will
be affected by a column change. The last thing I'd like to do is write a sql
parser - I'd end up spending most of my time getting the parser right instead
of attacking the real problem. Oracle already parses sql statements, so I'd
like to use the fruits of their labor.
I thought it would be a good idea to process each report one at a time: for each query in the report, run the query through EXPLAIN PLAN, then poke through V$ tables to find which columns are used.
It looks like using v$session, v$sql, & v$object_dependency will get me the objects (i.e., tables), but to meet the goal, I need to get down to the column level.
Anybody know how I can see what columns are used by a query already parsed & in the buffer? Alternately, anybody have a grammar (preferably for perl's Rec::Descent) to tear apart oracle sql?
Thanks. Sorry if this is a FAQ; I've poked around www.deja.com for quite a while with no results.
J.D. Laub (Laubster) |"I think you're very, very, very, very, very, jdl_at_iasi.com |very, very, very, very, ..." - Flying Lizards Received on Mon Oct 25 1999 - 15:34:22 CDT