hi ,
how can we save sql results to excell file with column headings.
I know TOAD can do this. but I need at sql plus.
ex:
SET PAGESIZE 10000;
SET LINESIZE 200;
spool h1.txt
--spool h1.xls
COLUMN empno heading 'EMPLOYEENUMBER' format A15;
COLUMN decode(ename, 'SMITH','SMITH',NULL)heading 'EMPLOYEEName' format A12;
select empno || ; ||
decode(ename, 'SMITH','SMITH',NULL) || ; ||
sal
from emp;
spool off;
when am giving this. for empno column heading, it is working. in column heading for decode..., it is not formatting to EMPLOYEEName and giving concat operator(||) is giving with headings, how do I get rid of this.
When Open in excell, the headings are like this.
EMPLOYEENUMBER||' '||decode()||'
I saw sqlplus column format, but could not find the solution
I know this way.
select empno employeenum,
decode(.....) employeename.
sal salary
from emp;
but I need in excell.
Please ignore my typing mistakes in writing sql query.
Thanks for your help.
how can we save sql results to excell file with column headings.
I know TOAD can do this. but I need at sql plus.
ex:
SET PAGESIZE 10000;
SET LINESIZE 200;
spool h1.txt
--spool h1.xls
COLUMN empno heading 'EMPLOYEENUMBER' format A15;
COLUMN decode(ename, 'SMITH','SMITH',NULL)heading 'EMPLOYEEName' format A12;
select empno || ; ||
decode(ename, 'SMITH','SMITH',NULL) || ; ||
sal
from emp;
spool off;
when am giving this. for empno column heading, it is working. in column heading for decode..., it is not formatting to EMPLOYEEName and giving concat operator(||) is giving with headings, how do I get rid of this.
When Open in excell, the headings are like this.
EMPLOYEENUMBER||' '||decode()||'
I saw sqlplus column format, but could not find the solution
I know this way.
select empno employeenum,
decode(.....) employeename.
sal salary
from emp;
but I need in excell.
Please ignore my typing mistakes in writing sql query.
Thanks for your help.