Re: Help with the describe command.

From: M. Armaghan Saqib <armaghan_at_yahoo.com>
Date: Thu, 27 Jan 2000 13:17:59 +0500
Message-ID: <86ou7h$29fj$2_at_dolf.netfront.net>


SQL Plus is quite limited when it comes to built-in commands to find info about database. You can use the following dictionary tables to get info about tables:

user_tables
user_tab_comments
user_tab_columns
user_col_comments
user_constraints

but it takes a lot of typing (and typing errors correction)

I developed my SQLPlusPlus (freeware) to overcome these (and other limitations). For example

SQL> exec s.lsttab -- Display list of all tables in current schema
| SCOTT BONUS
| SCOTT DEPT
| SCOTT EMP
| SCOTT MLOG$_EMP snapshot log for master table
SCOTT.EM
| SCOTT SALGRADE
| SCOTT SEQ_TABLE
| SCOTT SNAP$_EMP_SNAPSHOT snapshot table for snapshot
SCOTT.EMP_
| SCOTT SQLPP_HELP
| SCOTT SQLPP_OUTPUT
SQL> exec s.lstcon - List all constraitns (primery key/ foreign key/ others etc)
| SCOTT DEPT SYS_C001037
PRIMARY KEY
| SCOTT EMP EMP_VALID_JOB CHECK
| SCOTT EMP SYS_C001034 CHECK
| SCOTT EMP SYS_C001035
PRIMARY KEY
| SCOTT EMP_SNAPSHOT SYS_C001040 OTHER
| SCOTT SEQ_TABLE SYS_C001139
PRIMARY KEY
| SCOTT SNAP$_EMP_SNAPSHOT SYS_C0010351
PRIMARY KEY
| SCOTT SNAP$_EMP_SNAPSHOT SYS_C001038 CHECK
| SCOTT SQLPP_HELP SYS_C001251 CHECK
| SCOTT SQLPP_HELP SYS_C001252 CHECK
| SCOTT SQLPP_HELP SYS_C001253 CHECK
| SCOTT SQLPP_HELP SYS_C001254 CHECK
| SCOTT SQLPP_HELP SYS_C001255 CHECK
| SCOTT SQLPP_HELP SYS_C001256 CHECK
| SCOTT SQLPP_OUTPUT SYS_C001247 CHECK
| SCOTT SQLPP_OUTPUT SYS_C001248 CHECK
| SCOTT SQLPP_OUTPUT SYS_C001249 CHECK
| SCOTT SQLPP_OUTPUT SYS_C001250 CHECK
SQL> exec s.lsttcl('dept') -- List all columns for a table with comments.
| TABLE: dept
| COMM:
|
| COLUMN NAME TYPE SIZE DEC N DEFAULT
COMMEN
| ------------------------------ ---------- ---- --- - --------------- -----
-
| deptno NUMBER 2 0 N
| dname VARCHAR2 14 Y
| loc VARCHAR2 13 Y

regards,
M. Armaghan Saqib

+---------------------------------------------------------------

| 1. SQL PlusPlus => Add power to SQL Plus command line
| 2. SQL Link for XL => Integrate Oracle with XL
| 3. Oracle CBT with sample GL Accounting System
| Download free: http://www.geocities.com/armaghan/
+---------------------------------------------------------------
Michael Forman <michael.forman_at_tallan.com> wrote in message news:86ngok01jmk_at_enews5.newsguy.com...
> Hello,
>
> It's been several years since I used Oracle, and I forgot how to do a few
> things.
>
> Can someone refresh my memory on how to get SQL+ to give me a listing of
all
> my table names?
>
> Also, when I do a
>
> DESCRIBE XXX
>
> how can I tell what column(s) is the primary key?
>
> Thanks!
>
> -M
>
>




Posted via news://freenews.netfront.net
Complaints to news_at_netfront.net Received on Thu Jan 27 2000 - 09:17:59 CET

Original text of this message