SQL*Plus

From: Paul Krikorian <paulk_at_spock.dis.cccd.edu>
Date: 10 Jun 1993 05:41:23 -0700
Message-ID: <1v7a5j$sle_at_spock.dis.cccd.edu>


 Hello everyone,

      I have another SQL*Plus question. We are in the middle of our first  Oracle project and the database is changed occasionally. I like to work  from a printed copy of all the tables while I'm writing my PRO*COBOL  program. The 'DESCRIBE' command in SQL*Plus works great for detailing one  table, but since our database has over 40 tables, it is a pain printing  all the tables at once.

      I would like to create an SQL*Plus script that would use the data  stored in the system table USER_TAB_COLUMNS to print a report in the  following format:

 Table                 Column                          Null?    Type
 --------------------  ------------------------------- -------- ----
 table_1               column_1                        NOT NULL NUMBER
                       column_2                                 DATE
                       column_3                                 NUMBER
                       column_4                                 CHAR(x)

 table_2               column_1                                 CHAR(x)
                       .
		       .
		       .

 table_n               column_1                                 CHAR(x)


      I started writing the script and got part of it (not much), but
 decided to be lazy and just ask the net if there was an SQL*Plus command  for this or if anybody else knows how to accomplish it.  
      Places where I'm stuck are:

(1) how to suppress TABLE_NAME after first occurrence of table
(2) how to get the column NULLABLE to display as blanks when = 'Y'
and as 'NOT NULL' when = 'N'
(3) how to suppress DATA_LENGTH for data types like DATE or NUMBER
(4) how to skip a line between tables
Sorry if some of these things are simple, but I don't have much time
 to experiment with SQL*Plus.

 A big thank you in advance to anyone who replies!

-- 
Paul Krikorian                   | Internet: paulk_at_spock.dis.cccd.edu
Coast Community College District | Voice:    (714) 432-5150
1370 Adams Ave.                  | Fax:      (714) 432-5062
Costa Mesa, CA 92626, USA        |
Received on Thu Jun 10 1993 - 14:41:23 CEST

Original text of this message