'How to process whitespace while generating .xls file using Spool in sqlplus
When I am generating .xls report from sqlplus through spool it is truncating whitespace. I want to process the whitespace.In sql developer I can see the whitespace using below select query. I have turned off all SET trims parameter but it did not help.
SET COLSEP ','
set heading on
set linesize 32767
SET WRAP ON
set echo off
set trimout on
SET TERMOUT OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET MARKUP HTML ON SPOOL ON
SET PAGESIZE 50000
set trimspool on
whenever sqlerror exit 1;
whenever oserror exit 2;
spool "Report/product_report.csv"
select product_name,id from product where id in ('123','456','789');
spool off;
set markup html off spool off
output of the sql select query in sql developer -
product_name id
-------------------------
XCAPSULE PRO 123
YCAPSULE PRO 456
ZCAPSULE PRO 789
We expected below output in .xls report which should be same as output in sql developer
product_name id
-------------------------
XCAPSULE PRO 123
YCAPSULE PRO 456
ZCAPSULE PRO 789
in .xls report space are getting trimmed and output is coming as below
which is not expected to us
product_name id
-------------------------
XCAPSULE PRO 123
YCAPSULE PRO 456
ZCAPSULE PRO 789
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
