Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Describe all tables
Here's a script to run with SQL*Plus that gives all the tables
of the current schema with theirs columns and the type of each
one plus 'NOT NULL' if the column cannot be null.
Hope this is what you wish.
Set echo OFF
Set feedback OFF
Set heading OFF
Set linesize 2000
Set long 32760
Set newpage 0
Set pagesize 0
Set recsep OFF
Set space 0
Set trimout ON
Set trimspool ON
BTitle OFF
TTitle OFF
Spool desc
Select decode(col.column_id, 1, '
'||col.table_name||' ', '')|| ' '||col.column_name||' '||col.data_type|| decode(col.data_type,
'NUMBER', decode(col.data_precision,
NULL, decode(col.data_scale, NULL, '', '(38)'), '('||col.data_precision|| decode(col.data_scale, NULL, ')', ','||col.data_scale||')')),
'CHAR', '('||col.data_length||')',
'VARCHAR2', '('||col.data_length||')',
'RAW', '('||col.data_length||')'
)||
Spool off
HSK a écrit dans le message <7q0ues$20p$1_at_news.inet.tele.dk>...
>Hi.. > >Does anyone have, or know how to make, a SQL-script that describes all >tables a user owns (Oracle 7.3) ? > >regards, >HSK > >Received on Wed Aug 25 1999 - 10:20:52 CDT
![]() |
![]() |