Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Spaces in output while exporting data to csv through sql spool

User_AWHMXMar 5 2019 — edited Apr 29 2019

Hai everyone,

i write one query to export the data to excel csv format through sql spool query. In excel data is coming fine with headers. while i was opening the same file in .txt lot of spaces are coming in between.

i want to display the result without any spaces. i use the concatenation also but in header that concatenation symbol also coming.

spool query which i wrote

set embedded on

set colsep,

set headsep off

set pagesize 0

set trimspool on

set feedback off

set underline off

set echo off

SET TRIMOUT ON

set linesize 20000

set numwidth 30000

spool X:\FTPUpdates\Downloader\Download\new\1.csv

SELECT * FROM inv_item ;

spool off

exit /b

Result i am getting like below with lot of spaces. i use set tab on and set trim on but even though its same.

pastedImage_11.png

If i use query like below then same concatenation symbols also its coming in header.

select "date"||','|| "Out No"||','||"trx no" ||','||"country" from inv_item.

result like below.

pastedImage_12.png

Please help me how can i get the data without spaces or without truncate symbol from above header.

Regards,

sankar

This post has been answered by Racer I. on Mar 5 2019
Jump to Answer
Comments
Post Details
Added on Mar 5 2019
10 comments
3,162 views