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: <sybrandb_at_yahoo.com>
Date: 7 Jul 2004 04:32:50 -0700
Message-ID: <a1d154f4.0407070332.42c5981a@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

  1. select lpad(<your expression>,<max length>) ....
  2. the column command supports strings and numbers. Dates are treated as strings. You'll need to_char(<date>,'YYYY-MM-DD') in your select statement.

Sybrand Bakker
Senior Oracle DBA Received on Wed Jul 07 2004 - 06:32:50 CDT

Original text of this message

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