Home » SQL & PL/SQL » SQL & PL/SQL » definition of view
definition of view [message #287673] Thu, 13 December 2007 02:28 Go to next message
sathish.mellow
Messages: 32
Registered: December 2007
Location: Chennai
Member
Can anyone tell how to obtain the definition of view?
Re: definition of view [message #287674 is a reply to message #287673] Thu, 13 December 2007 02:31 Go to previous messageGo to next message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
You could have a look at data dictionary views:


  • USER_VIEWS
  • ALL_VIEWS
  • DBA_VIEWS


Re: definition of view [message #288097 is a reply to message #287673] Fri, 14 December 2007 15:46 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
you can also do this...

SQL> select* from user_Views;

no rows selected

SQL> create or replace view temp_vw
  2  as
  3  select *
  4  from dual
  5  /

View created.

SQL> set linesize 70
SQL> desc temp_vw
 Name                                Null?    Type
 ----------------------------------- -------- ------------------
 DUMMY                                        VARCHAR2(1)

SQL> set long 99999999
SQL> col text format a999
SQL> set linesize 999
SQL> select dbms_metadata.get_ddl('VIEW','TEMP_VW') text
  2  from dual
  3  /

TEXT
----------------------------------------------------------------

  CREATE OR REPLACE FORCE VIEW "KM21378"."TEMP_VW" ("DUMMY") AS
  select "DUMMY"
from dual



1 row selected.


http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm

Good luck, Kevin
Previous Topic: rows into columns and columns into rows
Next Topic: Help with query
Goto Forum:
  


Current Time: Sat Dec 10 18:34:53 CST 2016

Total time taken to generate the page: 0.09208 seconds