Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> How to open a cursor for the results of describe?

How to open a cursor for the results of describe?

From: Roel Schreurs <schreurs_roel_at_hotmail.com>
Date: 14 Mar 2005 02:38:20 -0800
Message-ID: <321ebdef.0503140238.ca20440@posting.google.com>


Hi All,

I need to know the column structure (name, datatype and length) of any table or view I can select from. This should include all tables and views that come availbale through a sysnonym, possible over a database link. In all_objects I can find all synonyms that I can access. In all_tab_columns, however, these synonyms are not listed. If I execute the following statement, these cases will show:

SELECT object_name
  FROM all_objects
 WHERE object_type = 'SYNONYM'
   AND owner != 'PUBLIC'
   AND object_name NOT IN

     ( SELECT table_name 
       FROM all_tab_columns 
     );

DESCRIBE <synonym>, using Toad, the column structure shows up nicely. Unfortunately, DESCRIBE is not available in PL/SQL. Is there a way to treive this information in PL/SQL, preferrably in a cursor? That is, some equivalent of:

  OPEN <My_Cursor>
   FOR
SELECT COLUMN_NAME
, DATA_TYPE
, CHAR_LENGTH

  FROM ALL_TAB_COLUMNS
 WHERE TABLE_NAME = <My_TableName>; Received on Mon Mar 14 2005 - 04:38:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US