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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

how to remove trailing white spaces in columns while using Spool

4068702Aug 21 2019 — edited Aug 21 2019

SET PAGESIZE 1000

SET COLSEP ,

SET WRAP OFF

SET HEADSEP OFF

SET UNDERLINE OFF

SET TRIMSPOOL ON

SET TRIMOUT ON

SET LINESIZE 2000

SET TERMOUT OFF

SET FEEDBACK OFF

SPOOL C:\Oracle\documents\emp.csv

SELECT * FROM EMP;

SPOOL OFF

Output is as following

EmployeeNumber,Employeename,EmployeeDepartment,EmployeeDesignation,EmployeeSalary

                    7657,             Andrew,                 Accounting,                                   ,               50000,

Comments

Post Details

Added on Aug 21 2019
12 comments
2,818 views