To keep the leading zeros when taking data into Excel, do three things:
1) pad with zeros,
2) concatenate with an equal sign
3) set Entmap Off for that particular column
SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
SET TERM OFF
COLUMN Empno ENTMAP OFF
SPOOL Employee.xls
Select '="'||LPad(EmpNo,8,0)||'"'
As
EmpNo,
--------------------------------
EName
From Emp;
SPOOL OFF
SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT OFF
SET TERM ON
See Oracle documentation for further detail:
Generating HTML Reports from SQL*Plus
Generating HTML Reports from SQL*Plus
Glad you found it useful.
ReplyDeleteThanks a lot !
ReplyDeleteI've searched this solution for hours ... !