Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: format of the output

Re: format of the output

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Wed, 25 Feb 2004 02:06:20 GMT
Message-ID: <vqT_b.9183$AL.183272@attbi_s03>

"Vu Pham" <vu_at_sivell.com> wrote in message news:c1gt97$1huaqg$1_at_ID-219297.news.uni-berlin.de...
>
> "Mark C. Stock" <mcstockX_at_Xenquery .com> wrote in message
> news:vdWdnboPlaA9I6bdRVn-gw_at_comcast.com...
> >
> > "Vu Pham" <vu_at_sivell.com> wrote in message
> > news:c1ge5r$1id6bc$1_at_ID-219297.news.uni-berlin.de...
> > | Two of the fields in my table are NAME CHAR(30) and SECTION CHAR(1)
> > |
> > | The following SQL produces the corresponding result;
> > | -----------------------------------------------
> > | SQL> select name, section from tablea;
> > |
> > | NAME S
> > | ------------------------------ -
> > | User 0 S
> > | User 1 E
> > | User 2 M
> > | ------------------------------------------------
> > |
> > | Is there anyway to control the field width of the output, something
that
> > can
> > | give me a result like ?
> > | NAME SECTION
> > | -------------- -----------
> > | User 0 S
> > | User 1 E
> > | User 2 M
> > |
> > |
> > | Thanks,
> > |
> > | Vu
> > |
> > |
> >
> >
> > you need the SQL*Plus COLUMN command, ie
> >
> > column name format a14
> > column section format a7
> >
> > note that these commands are in affect for the duration of the SQL*Plus
> > session (until you exit the tool) or until they are reset -- they are
not
> > tied to a specific SQL statement, so they will be applied to the results
> of
> > any column with the specified name
> >
> > check out the SQL*Plus guide for a lot more interesting settings
> >
>
> Thanks, Marc. Just downloaded the sqlplus pdf. Yes, it's interesting - and
> overloads me :-)
>
> Vu
>
>

The other problem is you are using char instead of varchar2 and are getting blank padded character strings.
You probably do not want to do that.
Jim Received on Tue Feb 24 2004 - 20:06:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US