Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQLPlus DESC Formatting

Posted on 2009-05-12
4
Medium Priority
?
862 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 16

Accepted Solution

by:
Milleniumaire earned 2000 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

604 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