Re: Which table holds the view cols?

From: Brian Peasland <oracle_dba_at_peasland.com>
Date: Mon, 18 Nov 2002 21:29:56 GMT
Message-ID: <3DD95BD4.8BDE9E56_at_peasland.com>


So use USER_TAB_COLUMNS instead:

ORA9I SQL> create view test_view as select * from emp;

View created.

ORA9I SQL> desc test_view

 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 EMPNO                                     NOT NULL NUMBER(4)
 ENAME                                              VARCHAR2(10)
 JOB                                                VARCHAR2(9)
 MGR                                                NUMBER(4)
 HIREDATE                                           DATE
 SAL                                                NUMBER(7,2)
 COMM                                               NUMBER(7,2)
 DEPTNO                                             NUMBER(2)

ORA9I SQL> select COLUMN_NAME from user_tab_columns   2 where table_name='TEST_VIEW';

COLUMN_NAME



EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO 8 rows selected.

Cheers,
Brian

Praveen wrote:
>
> Hi..All,
>
> Its very difficult to find out from the all_tab_columns coz, if user A has a
> table tab1 & gives grant select to user B. Then if i create view tab1 in user B,
> & try to select from all_tab_columns it gives multiple rows .
>
> Frank Diedrich wrote:
> > "Praveen" <p-nospam-mohanan_at_directvinternet.com> schrieb im Newsbeitrag
> > news:3DD53BD9.8090005_at_directvinternet.com...
> >
> >>Hi..All,
> >>
> >> When a user creates a table, all_tab_columns/user_tab_columns
> >
> > holds the
> >
> >>list of columns. When we create view, the all_views table hold only
> >
> > the text of
> >
> >>the view when it was generated. Which table holds the name of the
> >
> > columns of the
> >
> >>view?
> >>
> >>TIA
> >>
> >>P/
> >>
> >
> >
> > Try also all_tab_colums and take view:name for table_name...
> >
> > Greetings,
> >
> > Frank
> >
> >
Received on Mon Nov 18 2002 - 22:29:56 CET

Original text of this message