ADSM-L

Re: Formatting SQL select statement output

2000-09-14 18:30:24
Subject: Re: Formatting SQL select statement output
From: Andy Raibeck <Andrew_Raibeck AT TIVOLI DOT COM>
Date: Thu, 14 Sep 2000 15:30:25 -0700
You can try specifying a header for your columns that contains imbedded
blanks. For example (something a little simpler, but it illustrates what I
am saying):

select date_time as "Date and Time                 ",
       message as "Message       < 90 blanks >    "
       from actlog where date(date_time) = '2000-09-14'

I use a 132-column command prommpt, so this exploits the full width of my
command line window. Of course, don't use the text "< 90 blanks >"; I just
put it there to tell you how many blank spaces I used to pad out the
message header before closing the quote.

Regards,

Andy

Andy Raibeck
IBM/Tivoli
Tivoli Storage Manager Client Development
e-mail: andrew.raibeck AT tivoli DOT com
"The only dumb question is the one that goes unasked."

Formatting SQL select statement output
How do I change the output of the column width in a select statement?
Below is a select statement I am currently working on and would like to
expand the message column to something wider than the default 18 chr.

Dave T

ADSM  Version 3
        Release 1
        Level 2.3

select date_time as "Date and Time", message from actlog where msgno=1210
and cast((current_timestamp-date_time)days as decimal(12,0))<1 and
substr(message, 41, 7)='SRVTAPE' or (msgno=0986 and
cast((current_timestamp-date_time)days as decimal(12,0))<1 and
substr(message, 18, 2)=(select substr(message, 97, 2) from actlog where
msgno=1210 and cast((current_timestamp-date_time)days as decimal(12,0))<1
and substr(message, 41, 7)='SRVTAPE'))

     Date and Time     MESSAGE
------------------     ------------------
        2000-09-14     ANR1210I Backup of
        2000-09-14     ANR1210I Backup of
   02:00:17.000000      primary storage
                        pool SRVTAPE to
                        copy storage pool
                        OFFSITE started
                        as process 81.
        2000-09-14     ANR0986I Process
   02:35:00.000000      81 for BACKUP
                        STORAGE POOL
                        running in the
                        BACKGROUND
                        processed 1045
                        items for a total
                        of 10,893,062,729
                        bytes with a
                        completion state
                        of SUCCESS at
                        02:35:00.
<Prev in Thread] Current Thread [Next in Thread>