Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle reports question?
Iancrozier wrote:
> I am trying to output an Oracle report using sqlplus. I want the
> output to look
> like e.g. :
>
> ABCD,123,efg,456
> ABCDE,234,ghij,7893
>
> What I get is:
> ABCD ,123,efg ,456
> ABCDE,234,ghij,7893
>
> Note the extra spaces after ABCD and efg. I've tried rtrim, but that
> doesn't
> work, because there aren't really any spaces in the database.
> Any suggestions?
> TIA
Convert your char column to varchar2 because char columns are fixed
length.
I've tried this and it works.
create table ok (c1 varchar2(10), c2 varchar2(10)); create table notok (c1 char(10), c2 varchar2(10));
insert into ok values ('a', 'a');
insert into notok values ('b', 'b');
select 'good way: ' || c1 || ',' || c2 from ok;
select '!!!!' || c1 || ',' || c2 from notok;
drop table ok;
drop table notok;
god bye!!! Received on Thu May 21 1998 - 06:42:13 CDT