Home » RDBMS Server » Server Administration » Check view consists of which tables
Check view consists of which tables [message #232667] Sun, 22 April 2007 22:08 Go to next message
*Jess*
Messages: 48
Registered: December 2005
Location: Penang, Malaysia
Member

Hi,

How can I check on the base table of each view?

Thank you.
Re: Check view consists of which tables [message #232668 is a reply to message #232667] Sun, 22 April 2007 22:11 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
SQL> desc user_views
Re: Check view consists of which tables [message #232669 is a reply to message #232667] Sun, 22 April 2007 22:13 Go to previous messageGo to next message
*Jess*
Messages: 48
Registered: December 2005
Location: Penang, Malaysia
Member

There is no table name.

SQL> desc dba_views;
Name Null? Type
----------------------------------------- -------- ----------------------------
OWNER NOT NULL VARCHAR2(30)
VIEW_NAME NOT NULL VARCHAR2(30)
TEXT_LENGTH NUMBER
TEXT LONG
TYPE_TEXT_LENGTH NUMBER
TYPE_TEXT VARCHAR2(4000)
OID_TEXT_LENGTH NUMBER
OID_TEXT VARCHAR2(4000)
VIEW_TYPE_OWNER VARCHAR2(30)
VIEW_TYPE VARCHAR2(30)
Re: Check view consists of which tables [message #232670 is a reply to message #232667] Sun, 22 April 2007 22:15 Go to previous messageGo to next message
*Jess*
Messages: 48
Registered: December 2005
Location: Penang, Malaysia
Member

Hi,

Got it, thanks.
Re: Check view consists of which tables [message #232679 is a reply to message #232667] Mon, 23 April 2007 00:08 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
SQL> create view v as select * from t;

View created.

SQL> select referenced_owner, referenced_name, referenced_type
  2  from user_dependencies 
  3  where name='V' and type='VIEW';
REFERENCED_OWNER               REFERENCED_NAME                REFERENCED_TYPE
------------------------------ ------------------------------ -----------------
MICHEL                         T                              TABLE

1 row selected.

Regards
Michel
Previous Topic: Strange Trouble with 10g R2 EM
Next Topic: DBID
Goto Forum:
  


Current Time: Mon Dec 02 11:58:30 CST 2024