Solved

SQLPlus DESC Formatting

Posted on 2009-05-12
4
803 Views
Last Modified: 2013-12-18
Hello,

In SQLPlus it seems the output of a DESC command on a table does not respect COL <col_name> FORMAT Ann.  I'd like to trim the TYPE and NAME output to about 25 characters.

How can one do this?

Thanks,

Michael
Name                                                                                                                              Null?

Type

 ----------------------------------------------------------------------------------------------------------------------------------------- -

------- --------------------------------------------------------------------------------------------

 ADDITIONALACCOUNTS_ID                                                                                                             NOT NULL

NUMBER(12)

 CUMEMBERS_ID                                                                                                                      NOT NULL

NUMBER(12)

 ADDITIONALACCT

NUMBER(9)

 CREATETIMESTAMP

DATE

 UPDATETIMESTAMP

DATE

 UPDATECOUNTER

NUMBER(12)

 DELETED

NUMBER(12)

Open in new window

0
Comment
Question by:michael4606
4 Comments
 
LVL 16

Accepted Solution

by:
Milleniumaire earned 500 total points
ID: 24363798
Have you tried reducing the setting of linesize as this affects the column sizes used by describe.

e.g. set linesize 80
0
 

Expert Comment

by:atyrsvc
ID: 24363882
Instead of DESC <table>, you can do query on DICT tables like Select * from all_tables where table_name = 'XYZ'. This query will honor your COL format. You can save this in a script like DESC1 and have tablename as parameter for easy access.
0
 

Author Closing Comment

by:michael4606
ID: 31580499
Bingo - that was it.

Milleniumaire thanks for posting!
0
 
LVL 11

Expert Comment

by:Andytw
ID: 24363936
Milleniumaire is correct, use linesize

See Extract from the Oracle Docs SQL*Plus® User's Guide and Reference
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/toc.htm

<snip>
To format the DESCRIBE output use the SET command as follows:

SET LINESIZE 80
SET DESCRIBE DEPTH 2
SET DESCRIBE INDENT ON
SET DESCRIBE LINE OFF
To display the settings for the object, use the SHOW command as follows:

SHOW DESCRIBE
DESCRIBE DEPTH 2 LINENUM OFF INDENT ON
</snip>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
oracle query help 18 99
Wrap Oraccle SQL*Plus executable Command 4 68
case statement in where clause with not exist 15 46
Performance issue with case statement in oracle 11G 7 45
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now