My Oracle Support Banner

How To Append a Specific Number of Spaces at the End of Each Spooled Line From SQL*Plus (Doc ID 1085544.1)

Last updated on AUGUST 20, 2020

Applies to:

SQL*Plus - Version 11.2.0.1 and later
Information in this document applies to any platform.

Goal

If you need to spool files using SQL*Plus and need to append on each line a specific number of spaces, you will see that the length of the line and the spaces at the end are defaulted to the LINESIZE.

The issue here is because TRIMSPOOL is OFF, by default.
If you set TRIMSPOOL ON, then the appended spaces will be removed.  This is expected behavior.  When TRIMSPOOL is ON, then all spaces at the end are trimmed off.
So, how can you append a specific number of spaces at the end of each spooled line?



Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.