Using DESCRIBE to Get Information on Object Types


You can use the DESCRIBE command to get information on object types. The following examples describe address_typ and person_typ :

  DESCRIBE address_typ  Name Null? Type  ----------------------------------------- -------- ------------  STREET VARCHAR2(15)  CITY VARCHAR2(15)  STATE CHAR(2)  ZIP VARCHAR2(5)  DESCRIBE person_typ  Name Null? Type  ----------------------------------------- -------- ------------  ID NUMBER  FIRST_NAME VARCHAR2(10)  LAST_NAME VARCHAR2(10)  DOB DATE  PHONE VARCHAR2(12)  ADDRESS ADDRESS_TYP 

You can set the depth to which DESCRIBE will show information using SET DESCRIBE DEPTH . The following example sets the depth to 2 and then describes person_typ again. Notice the attributes of address are displayed ( address is of type address_typ ):

  SET DESCRIBE DEPTH 2   DESCRIBE person_typ  Name Null? Type  ----------------------------------------- -------- ------------  ID NUMBER  FIRST_NAME VARCHAR2(10)  LAST_NAME VARCHAR2(10)  DOB DATE  PHONE VARCHAR2(12)  ADDRESS ADDRESS_TYP  STREET VARCHAR2(15)  CITY VARCHAR2(15)  STATE CHAR(2)  ZIP VARCHAR2(5) 



Oracle Database 10g SQL
Oracle Database 10g SQL (Osborne ORACLE Press Series)
ISBN: 0072229810
EAN: 2147483647
Year: 2004
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net