Re: col widths in sql in ora 9

From: mcstock <mcstockspamplug_at_spamdamenquery.com>
Date: Thu, 13 Nov 2003 15:56:11 -0500
Message-ID: <ZcCdnTOITtpuci6i4p2dnA_at_comcast.com>


[Quoted] as noted in the other post, you need to use the SQL*Plus COLUMN command to control SQL*Plus output

[Quoted] this is best done in the script that contains the SQL statement

[Quoted] these setting remain in effect for the SQL*Plus (not database server) session -- so they don't change if you connect to another database

[Quoted] so best practice is issue explicit COLUMN commands at the beginning of a script, perhaps setting common ones via a START <scriptfile> command, then [Quoted] at the end of the script, reset the SQL*Plus environment -- preferably via another START <scriptfile> command

while you're at it, research these typical SQL*Plus formatting commands if you've not done so already:

PAGESIZE
LINESIZE
PAUSE
FEEDBACK
SPOOL
TRIMSPOOL
VERIFY
ECHO
BREAK
COMPUTE
CLEAR

  • mcs

"Malcolm Dew-Jones" <yf110_at_vtn1.victoria.tc.ca> wrote in message news:3fb3de92_at_news.victoria.tc.ca...
>
> 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
>
Received on Thu Nov 13 2003 - 21:56:11 CET

Original text of this message