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 -> Re: DESCRIBE <table_name> in SQL*Plus

Re: DESCRIBE <table_name> in SQL*Plus

From: Tasm <tasm_at_tasm.com>
Date: Mon, 14 Aug 2006 09:56:12 +1000
Message-ID: <eboe6s$17vr$1@bunyip2.cc.uq.edu.au>


This is all the SQL, taken from a trace file, of a user executing the following command in 10.2.0.2.0.

DESC PSOPRDEFN SELECT /*+RULE */ TABLE_OWNER, TABLE_NAME, DB_LINK FROM
  ALL_SYNONYMS WHERE OWNER = 'PUBLIC' AND SYNONYM_NAME = 'PSOPRDEFN'   select /*+RULE */ 'SYNONYM' ot
from
  all_synonyms where owner = 'PUBLIC' and synonym_name = 'PSOPRDEFN'

select

   column_name "Name",
   decode(nullable, 'Y', '', 'N', 'NOT NULL', nullable) "Null?",    decode( data_type,

     'CHAR', data_type || '(' || data_length || ')',
     'NCHAR', data_type || '(' || data_length/2 || ')',
     'VARCHAR2', data_type || '(' || data_length || ')',
     'NVARCHAR2', data_type || '(' || data_length/2 || ')',
     'NUMBER', data_type ||
       decode( data_precision,
         '', decode(data_scale, 0, '(38)', '', ''),
         '(' || data_precision || decode(data_scale, 0, '', '', '', ',' || 
data_scale) || ')'
       ),
     'FLOAT', data_type || decode(data_precision, '', '', '(' || data_precision 
|| ')'),
     'RAW', data_type || '(' || data_length || ')', data_type) "Type"
from

   all_tab_columns
where

   owner = 'PS'
   and table_name = 'PSOPRDEFN' order by column_id

select /*+RULE */ object_type
from
  all_objects where owner = 'PS' and object_name = 'PSOPRDEFN' and    object_type <> 'TABLE PARTITION'

select /*+RULE */ user, object_type
from
  user_objects where object_name = 'PSOPRDEFN' and object_type <> 'TABLE    PARTITION' Please note that there is a bug (<<BUG:5074323>> - After Upgrading To 10.1.0.5 Queries On All_Synonyms Slow) is in 10g that makes the describe execute slowly when there are thousands of public synonym.

Spendius wrote:
> Hi,
> Where does SQL*Plus get the info displayed when you do
> a DESC <table> ? I thought doing a trace would show me
> selects against SYS.COL$ and stuff but it doesn't. So where
> is this program getting its information from ??
> Thanks.
> Spendius
>
Received on Sun Aug 13 2006 - 18:56:12 CDT

Original text of this message

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