Pages

Popular Posts

Tuesday, March 11, 2008

How to View/Extract Oracle view definition in Oracle Database

How to View/Extract Oracle view definition in Oracle Database. Oracle Database 9i 10g 11g

SQL> set long 10000

SQL>select text from dba_views where view_name like "YOUR_VIEW_NAME"

dba_views holds the definition of the view.

Alternative (and better) way is to use GET_DDL() function of metadata package DBMS_METADATA.

select DBMS_METADATA.GET_DDL('Object_Type','Object_name ','owner') for example:


SQL>set long 10000
SQL>select DBMS_METADATA.GET_DDL('VIEW','COU_VW','PRCOWN') FROM dual;

1 comment:

aliyaa said...

The database assignment help you in your projects where you can find your answers very easily.