varalu 0 Report post Posted December 3, 2008 All,If someone is working in oracle... and have some time to explore... try this and help me finish my job .Is it possible to get the underlying query for a view? If yes... how?Considerations:- Normal user -- Just select privileges on the view...- No external app. to access the DB. Just the basic editor.Thanks.In some cases where there is an UI... like in MS SQl, there should be an option to get the underlying query just by right clicking and selecting an option of the view. But in this case... I need the solution to get the underlying view via a query.I am sure there should be such an option... I have seen people modify the view, which is not possible if they do not have the query itself itself in the first place... Share this post Link to post Share on other sites
varalu 0 Report post Posted December 13, 2008 (edited) Ok.. I got the solution for this and is the best solution.It has something to do with the metadata.All the details about the views are stored in a metadata table called all_views.When I talk about all the details, it also means that details about the query that constructed about the view too.All I had to do is to write the below query to get the underlying query. Simple. select TEXT from all_views where VIEW_NAME='VIEW_NAME'; You might have to replace the VIEW_NAME in single quotes with the actual view name.There is also this thing of privileges. You might need privileges to access the metadata.Hope this helps.Thanks to Karthikeyan who helped me in this. Check out the comments section of the post. Edited December 13, 2008 by varalu (see edit history) Share this post Link to post Share on other sites