hi all,
I have created following script file, when I run it contain 1 blank line before and 2 lines between both output, how I can have no lines before and in between and eliminate last line is " 50 rows selected " - definitely i am missing SQL*Plus option to use, please help/guide.
set head off
set termout off
column dtcol new_value SYSDATE noprint
select to_char(sysdate,'YYYYMMDD') dtcol from dual;
spool E:\Test\testlog.&sysdate.csv create
select 'EMPID,LAST_NAME,DATE' from dual;
spool off
spool E:\Test\testlog.&sysdate.csv append
select employee_id||','||last_name||','||to_char(hire_date,'DDMMYYYY') Data
from (select * from employees order by 1)
where rownum<=50;
spool off
set termout on
Output is:
EMPID,LAST_NAME,DATE
100,King,17062003
101,Kochhar,21092005
102,De Haan,13012001
103,Hunold,03012006
...
50 rows selected.
the requirement is to generate this file during oracle job which calls a procedure to send email, I have to maintain Log in CSV in both cases Success or Failure of each and every emails. is it correct approach or any better idea ?
regards