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: formatting output from a column in sql plus

Re: formatting output from a column in sql plus

From: Tony <andrewst_at_onetel.net.uk>
Date: 7 Jul 2004 04:35:50 -0700
Message-ID: <c0e3f26e.0407070335.2b5e9558@posting.google.com>


"amwi" <amwi_at_yahoo.com> wrote in message news:<95NGc.98019$dP1.327068_at_newsc.telia.net>...
> I have read the documentation of the column command in sql plus version 10.1
> and i still don't understand how to format the data field as follows.
> I have tried different ways to use the column command, without success,
> believe me...
>
> Questions:
> 1) How to format a varchar2 field so that it is "right justified"?
> 2) How do i format a date field as follows 'YYYY-MM-DD' with the help of the
> column command, if possible?
>
> Thank you

The column command doesn't do either of those things, unfortunately for you.
1) Use LPAD(col,<width>) in the SQL
2) Use TO_CHAR(col,'YYYY-MM-DD') in the SQL, or SET NLS_DATE_FORMAT = 'YYYY-MM-DD' if you want the same format for ALL columns. Received on Wed Jul 07 2004 - 06:35:50 CDT

Original text of this message

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