Re: Q: col widths in sql in ora 9
Date: 13 Nov 2003 13:59:40 -0800
Message-ID: <3fb3fecc_at_news.victoria.tc.ca>
[Quoted] Frank (fvanbortel_at_netscape.net) wrote:
: Malcolm Dew-Jones wrote:
: > I wish to control the colum widths of data in numerous utilitiy queries I
: > often run while examining various databases.
: >
: > In the past I simply used substr to limit the width.
: >
: > For example
: >
: > select
: > substr( DB_LINK,1,30) DB_LINK
: > ,substr( USERNAME,1,30) USERNAME
: > ,substr( PASSWORD,1,30) PASSWORD
: > ,substr( HOST,1,30) HOST
: > from user_db_links ;
: >
: > This produces an output of about 120 chars wide -- except when I connect
: > to one specific server which prints headers that are apparently the full
: > width of the column instead of the width of the selected data. The only
: > difference I can see is that the server is version 9 whereas all the other
: > servers are version 8 (or less, but I no longer access any thing less than
: > 8).
: >
: > I type "column" and various defaults are displayed, but I see no
: > difference based on which server I am connected to.
: >
: > I certainly don't wish to have to define individual columm headers for all
: > these queries. In addition to having to change a bunch of scripts, it
: > also means that each script will then potentially be altering the settings
: > used by other queries.
: >
: > Is there some global technique to fix this apparent incompatibility?
: >
: > define shows
: >
: > DEFINE _SQLPLUS_RELEASE = "800060000" (CHAR)
: > DEFINE _O_VERSION = "Oracle9i Enterprise Edition Release 9.2.0.2.0 -
: > Production
: >
: Read up SQL*Plus Reference Manual:
: COL[umn] <column_name> FOR[mat] A<width>|9999999
Are you saying that COLUMN has an option to force the displayed column width to be the same as the width of the selected data for every column? (Which is how oracle has always worked in the past). I do not see that option in my manual.
As I said, I do not wish to have to use COLUMN to define the widths because that means that my utility queries potentially alter what ever other COLUMN widths are already in place for other, more "important" queries. Also, I have about 126 such useful little queries, and it's absurd to have to update them all simply to fix a change in behaviour of the server for a technique that has worked for every version or oracle I can remember from the past for, well, years now. Also, the technique (of using COLUMN) does not lend itself to interactive queries because you have to predetermine what ever columns you wish ahead of time, instead of simply typing in a query that gives you want the way you want it when you ask for it. Received on Thu Nov 13 2003 - 22:59:40 CET