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: Flat file creation problems

Re: Flat file creation problems

From: Steve McDaniels <steve.mcdaniels_at_sierra.com>
Date: Thu, 20 Jan 2000 13:25:22 -0800
Message-ID: <867uoc$pl2$1@plo.sierra.com>


I would NOT use a separator because one cannot guarantee that the separator is not part of the data.

Try something like RTRIM on the offending field(s)

select rtrim(column1) a, ...

Sybrand Bakker <postmaster_at_sybrandb.demon.nl> wrote in message news:948383034.9358.0.pluto.d4ee154e_at_news.demon.nl...
> Assuming you refer to AY 11111, you hit a 'feature'. Any numeric column
> always has an extra position for the sign, which contains a '-' when the
> number is negative and a ' ' when the number is positive.
> Personally I would use a separator like a ',' or a '|'. In your case you
> probably need to suppress the unwanted space by using to_char.
>
> Hth,
>
> --
> Sybrand Bakker, Oracle DBA
> Ste C. <stephencassidy_at_my-deja.com> wrote in message
> news:8678so$5g5$1_at_nnrp1.deja.com...
> > I want to create a flat file from a table
> >
> > I've set up the following
> >
> > set head off
> > set pages 0
> > set newp 0
> > set lines 132
> > set echo off
> > set feed off
> > set spac 0
> > column a format 99999
> > column b format a25
> > column c format a1
> > column z format 9999
> >
> > spool temp.lis;
> >
> > select column1 a,
> > column2 b,
> > column3 c,
> > column4 z
> > from columns
> > where column3 = 'Y'
> > /
> > spool off
> > /
> >
> > when I edit the file temp.lis the output looks like
> >
> > 11111AAAAAAAAAAAAAAAAAAAAAAAAAY 1111
> > 22222AAAAAAAAAAAAAAAAAAAAAAAAAY 2222
> > 33333AAAAAAAAAAAAAAAAAAAAAAAAAY 3333
> > 44444AAAAAAAAAAAAAAAAAAAAAAAAAY 4444
> > 55555AAAAAAAAAAAAAAAAAAAAAAAAAY 5555
> > ^ unknown space
> >
> > for some reason there is a space appearing where there shouldn't be
> > one. Does anybody have any idead as to why this is happening ?
> >
> > --
> > Arrgh
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Received on Thu Jan 20 2000 - 15:25:22 CST

Original text of this message

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