RE: How to Find Every View In Which a Column is Used.
Ugly way: 1- Select the list of valid views. 2- Rename the table. 3- Create new table with the same name but missing the column (empty table). 4- Compile all views. 5- Invalid views are using this column. Regards, Waleed -Original Message- Sent: Thursday, April 11, 2002 5:19 PM To: Multiple recipients of list ORACLE-L "MacGregor, Ian A." wrote: > > The dependencies tables do not go down to the column level. If I want to know all views that access the sal column of scott.emp how do I do this. I can find out the name of the views which access the table via "dependencies", get the view text and parse it by eye. But I don't want to do that. I want the database to do so. I can use dbms_dql.parse, dbms_sql.describe columns, and the text of the view; however, this method does not work very well if the view contains a function or an operation on the column. > > Oracle must hold this information somewhere after a statement is parsed, but where ? > > Ian Ian, To the best of my knowledge, the 'per column' dependency is not stored in the dictionary. The finest grain is the dependence of the view on the table. And as you pointed out, the description gives you the column name, which is arbitrary. No way out but parsing a LONG column :-P. -- Regards, Stephane Faroult Oriole Software -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stephane Faroult INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Khedr, Waleed INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: How to Find Every View In Which a Column is Used.
Ian, AFAIK, there is no direct way, as the view text is stored in dba_views and column list can be seen in ALL|DBA_tab_columns. Looks like you'll have to do some parsing ... but on the brighter side, you can restrict your look up to only those views that appeared in the dependency list of the table first. raj __ Rajendra Jamadagni MIS, ESPN Inc. Rajendra dot Jamadagni at ESPN dot com Any opinion expressed here is personal and doesn't reflect that of ESPN Inc. QOTD: Any clod can have facts, but having an opinion is an art! ***1 This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify ESPN at (860) 766-2000 and delete this e-mail message from your computer, Thank you. ***1
Re: How to Find Every View In Which a Column is Used.
"MacGregor, Ian A." wrote: > > The dependencies tables do not go down to the column level. If I want to know all >views that access the sal column of scott.emp how do I do this. I can find out the >name of the views which access the table via "dependencies", get the view text and >parse it by eye. But I don't want to do that. I want the database to do so. I can >use dbms_dql.parse, dbms_sql.describe columns, and the text of the view; however, >this method does not work very well if the view contains a function or an operation >on the column. > > Oracle must hold this information somewhere after a statement is parsed, but where ? > > Ian Ian, To the best of my knowledge, the 'per column' dependency is not stored in the dictionary. The finest grain is the dependence of the view on the table. And as you pointed out, the description gives you the column name, which is arbitrary. No way out but parsing a LONG column :-P. -- Regards, Stephane Faroult Oriole Software -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stephane Faroult INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
How to Find Every View In Which a Column is Used.
The dependencies tables do not go down to the column level. If I want to know all views that access the sal column of scott.emp how do I do this. I can find out the name of the views which access the table via "dependencies", get the view text and parse it by eye. But I don't want to do that. I want the database to do so. I can use dbms_dql.parse, dbms_sql.describe columns, and the text of the view; however, this method does not work very well if the view contains a function or an operation on the column. Oracle must hold this information somewhere after a statement is parsed, but where ? Ian -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: MacGregor, Ian A. INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).