Re: Q: col widths in sql in ora 9

From: Frank <fbortel_at_nescape.net>
Date: Fri, 14 Nov 2003 12:26:09 +0100
Message-ID: <bp2dlb$8vk$1_at_news4.tilbu1.nb.home.nl>


Malcolm Dew-Jones wrote:
> 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.
>
Must have misinterpreted the question.

The behavior used to be:
- Width or the data, or
[Quoted] - Width or the column Header
whichever was greater.

[Quoted] It seems the behaviour is changed to use the actual column_name as basis for width, not the column header...

[Quoted] At least one bug was filed (2092801), and this had to do with cursor_sharing. 1981077 reports your problem, and is closed as not a bug - has to do with UTF (multibyte language) in the db; try using substrb

-- 
Regards, Frank van Bortel
Received on Fri Nov 14 2003 - 12:26:09 CET

Original text of this message