problem in removing spaces [message #197119] |
Tue, 10 October 2006 02:24 |
satya_jsr
Messages: 10 Registered: October 2006
|
Junior Member |
|
|
I am generating the report by spooling.
In that report I have computed Total.I have the problem that its having spaces before the number.
How to remove those spaces.
|
|
|
|
Re: problem in removing spaces [message #197128 is a reply to message #197122] |
Tue, 10 October 2006 03:16 |
satya_jsr
Messages: 10 Registered: October 2006
|
Junior Member |
|
|
Thanks Littlefoot for ur comment.
But LTRIM didnt worked as i m computin the total so its a noumber only.
The format is like this
NAME EMPNO JOB DATE SAL
AAA 111 A1 01-OCT-2006 100
AAA 111 A1 02-OCT-2006 100
***************
TOTAL 200
BBB 222 B2 01-OCT-2006 100
BBB 222 B2 02-OCT-2006 100
BBB 222 B2 03-OCT-2006 100
***************
TOTAL 300
here on column SAL and in TOTAL I am getting spaces.
I want to remove that spaces.
|
|
|
|
Re: problem in removing spaces [message #197138 is a reply to message #197129] |
Tue, 10 October 2006 04:08 |
satya_jsr
Messages: 10 Registered: October 2006
|
Junior Member |
|
|
Its actually a .csv file.
And in the TOTAL column where the value is 200,before that value there is spaces in that column.
I wanted to remove that spaces.
Its like
TOTAL, 200
and I want as
TOTAL,200
|
|
|
|
Re: problem in removing spaces [message #197142 is a reply to message #197139] |
Tue, 10 October 2006 04:44 |
satya_jsr
Messages: 10 Registered: October 2006
|
Junior Member |
|
|
Ya I have used that.
The query is like
"
break on EMPNO duplicate skip 1
compute sum LABEL 'TOTAL' of TOTAL on EMPNO
spool C:\test.csv
select 'NAME','EMPNO','JOB','DATE','SOLD' from DUAL;
select name
|| ',' ||empno
|| ',' ||job
,trunc(insert_timestamp) "DATE"
,count(*) "TOTAL"
from EMP
group by name,job,trunc(insert_timestamp)
order by EMPNO;;
"
Here the SOLD field is as the Employee selling some product in one particular date,so for each employee whouse EMPNO is uniqe has a TOTAL at last.
Now in TOTAL column the value for TOTAL is coming with spaces.
[Updated on: Tue, 10 October 2006 04:58] Report message to a moderator
|
|
|
Re: problem in removing spaces [message #197153 is a reply to message #197142] |
Tue, 10 October 2006 05:07 |
satya_jsr
Messages: 10 Registered: October 2006
|
Junior Member |
|
|
neglect the earliear reply
"
break on EMPNO duplicate skip 1
compute sum LABEL 'TOTAL' of TOTAL on EMPNO
spool C:\test.csv
select 'NAME','EMPNO','PROD','DATE','SOLD' from DUAL;
select name
|| ',' ||empno
|| ',' ||prod
,trunc(insert_timestamp) "DATE"
,count(*) "TOTAL"
from EMP
group by name,prod,trunc(insert_timestamp)
order by EMPNO;;
"
Here the SOLD field is as the Employee selling some product in one particular date,so for each employee whouse EMPNO is uniqe has a TOTAL at last.
Now in TOTAL column the value for TOTAL is coming with spaces.
|
|
|
|
|
|