Category : Databases and related files
Archive   : DBATOOLS.ZIP
Filename : DESCRIBE.RPT

 
Output of file : DESCRIBE.RPT contained in archive : DBATOOLS.ZIP
.REM ****************************************************************
.REM
.REM This file produces a report of all tables accessible
.REM to an Oracle account. The output is similar to the DESCRIBE
.REM command in SQL*Plus, but it includes all tables in the user's
.REM account plus table and column comments, and SQL statement text
.REM for views.
.REM
.REM Usage: RPT describe describe user/pwd
.REM RPF describe describe
.REM
.REM The output will be placed in describe.lis
.REM
.REM 6/3/87 Bill Maimone, Associate Consultant
.REM
.REM ****************************************************************

.REM ****************************************************************
.REM
.REM Declare variables.
.REM
.REM ****************************************************************
.declare tname a30
.declare creator a30
.declare tabletype a31
.declare cname a30
.declare coltype a6
.declare width 9999
.declare scale 9999
.declare nulls a8
.declare viewtext a240
.declare cremarks a240
.declare tremarks a240
.declare header a80

#dt 1 5 25 27 32 34 38 40 44 46 54 56 80 #
#dt 2 5 80 #
.REM *****************************************************************
.REM
.REM Define the selection macros.
.REM
.REM *****************************************************************
.REM
.REM Select all tables and views for the user.
.REM
.define seltables
SELECT TNAME,CREATOR,TABLETYPE||':',REMARKS
INTO tname,creator,tabletype,tremarks
FROM CATALOG
ORDER BY TNAME,CREATOR
..
.REM
.REM Select the columns in the users's tables
.REM
.define selcolumns
SELECT CNAME,WIDTH,SCALE,COLTYPE,NULLS,REMARKS
INTO cname,width,scale,coltype,nulls,cremarks
FROM COLUMNS
WHERE TNAME = &tname
AND CREATOR = &creator
ORDER BY COLNO
..
.REM
.REM Select the text of the SQL statement for views.
.REM
.define selsqltext
SELECT VIEWTEXT
INTO viewtext
FROM VIEWS
WHERE VIEWNAME = &tname
..
.REM
.REM Get the username and today's date.
.REM
.define seluser
SELECT 'Tables and Views for '||USER||' as of '||
TO_CHAR(SYSDATE,'Month DD, YYYY HH:MIpm')
INTO header
FROM SYSTEM.DUAL
..

.REM ****************************************************************
.REM
.REM Define the report output macros.
.REM
.REM ****************************************************************
.REM
.REM Output column description information.
.REM
.define colrpt
#t 1
.print cname
#nc #r
.print coltype
#nc #r
.print width
#nc #r
.print scale
#nc #r
.print nulls
#nc #rr
.print cremarks
#te
..
.REM
.REM Output Table information.
.REM
.define tabrpt
#t 2
.print tabletype
.print tname
#b
CREATOR:
.print creator
#s 1
.IF &tabletype!='VIEW:' THEN notview
.execute selsqltext
VIEWTEXT:
.print viewtext
#s 1
.¬view
.IFNULL tremarks noremarks
#rr
.print tremarks
#s 1
.&noremarks
============================================================================
#te
#t 1
Column
#nc
Type
#nc
Width
#nc
Scale
#nc
Nulls
#nc
Comments
#nc
=====================
#nc
======
#nc
=====
#nc
=====
#nc
=========
#nc
=========================
#te
.report selcolumns colrpt
#s 2
..

.define header
#t 2 #cul
.print header
#s 3
#te
..

.REM ****************************************************************
.REM
.REM Generate the report.
.REM
.REM ****************************************************************
.report seluser header
.report seltables tabrpt


  3 Responses to “Category : Databases and related files
Archive   : DBATOOLS.ZIP
Filename : DESCRIBE.RPT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/