Hi, I try to spool data from database to textfile. My coding as below, but the problem now i cannot remove the space in text file. The output will be like this:-
Sample Output:
282|282000000792007 |23102007 | 1
The output that i want is like this:-
282|282000000792007|23102007|1
set trimspool on
spool on
spool D:\...
select to_char(trunc(a.T_157_Branch),'000'), (a.T_4071_New_Application_Number), (a.T_151_Application_Date) ,
CASE
WHEN to_number(substr(a.T_153_Application_Type,1,3)) is NULL THEN 0
ELSE a.T_153_Application_Type
END as App_type
from applicationdata a
inner join mainappdata b on a.sys_recordkey = b.sys_recordkey
inner join businessdata c on b.sys_recordkey = c.sys_recordkey
where (FINAL_APP_DATE is not null
AND FINAL_APP_DATE= (to_char(trunc(SYSDATE-1),'DDMMYYYY'))
AND STATUS ='12') OR EXTRA = 'Y'
AND
((length(Branch) = 1) OR (length(Branch) = 2) OR (length(Branch) = 3));
spool off
Anyone can help me!!
Thank you.
Sample Output:
282|282000000792007 |23102007 | 1
The output that i want is like this:-
282|282000000792007|23102007|1
set trimspool on
spool on
spool D:\...
select to_char(trunc(a.T_157_Branch),'000'), (a.T_4071_New_Application_Number), (a.T_151_Application_Date) ,
CASE
WHEN to_number(substr(a.T_153_Application_Type,1,3)) is NULL THEN 0
ELSE a.T_153_Application_Type
END as App_type
from applicationdata a
inner join mainappdata b on a.sys_recordkey = b.sys_recordkey
inner join businessdata c on b.sys_recordkey = c.sys_recordkey
where (FINAL_APP_DATE is not null
AND FINAL_APP_DATE= (to_char(trunc(SYSDATE-1),'DDMMYYYY'))
AND STATUS ='12') OR EXTRA = 'Y'
AND
((length(Branch) = 1) OR (length(Branch) = 2) OR (length(Branch) = 3));
spool off
Anyone can help me!!
Thank you.