Exit SQL includes a lot of empty space - can I get rid of him?

I have a simple piece of SQL running in an Oracle EBS table:

SET LINESIZE 1000
SPOOL c:\temp\oracle\test.txt
SET TRIMSPOOL ON
SET TRIMOUT ON
SELECT TRIM(fu.user_name) user_name
     , TRIM(fu.user_id) user_id
     , TRIM(fu.description) description
     , TRIM(fu.email_address) email_address
     , TRIM(fu.fax) fax
     , TRIM(fu.person_party_id) person_party_id
  FROM applsys.fnd_user fu
 WHERE user_name = 'ZZZAAAB';
SPOOL OFF

The info for the selected fields:

 Name              Null?    Type
 ----------------- -------- ----------------------------
 USER_ID           NOT NULL NUMBER(15)
 USER_NAME         NOT NULL VARCHAR2(100)
 DESCRIPTION                VARCHAR2(240)
 EMAIL_ADDRESS              VARCHAR2(240)
 FAX                        VARCHAR2(80)
 PERSON_PARTY_ID            NUMBER

When I look at the content of "test.txt", they appear as follows:

USER_NAME                                                                                            USER_ID                                  DESCRIPTION                                                                                                                                                                                                                                      EMAIL_ADDRESS                                                                                                                                                                                                                                    FAX                                                                              PERSON_PARTY_ID                         
---------------------------------------------------------------------------------------------------- ---------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- ----------------------------------------
ZZZAAABB                                                                                             12345                                    Joseph Bloggs                                                                                                                                                                                                                                    [email protected]                                                                                                                                                                                                                 June 15 rev:SEPT REV 051214; jun15 rev                                           11144455                                
1 row selected.

There is a huge amount of fill / empty space between fields and the total width of the data is 746 characters. I tried TRIM, TRIMOUT and TRIMSPOOL, but none makes no difference.

I tried a LINESIZE over small example 700, but data encapsulates then as follows:

USER_NAME                                                                                            USER_ID                                  DESCRIPTION                                                                                                                                                                                                                                      EMAIL_ADDRESS                                                                                                                                                                                                                                   
---------------------------------------------------------------------------------------------------- ---------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FAX                                                                              PERSON_PARTY_ID                         
-------------------------------------------------------------------------------- ----------------------------------------
ZZZAAABB                                                                                             12345                                    Joseph Bloggs                                                                                                                                                                                                                                    [email protected]                                                                                                                                                                                                                  
June 15 rev:SEPT REV 051214; jun15 rev                                           11144455
1 row selected.

If I use dummy data, the result is nice and compact:

SET LINESIZE 200

with tbl_data AS
(SELECT 'ZZZAAAB' user_name
      , 12345 user_id
      , 'Joseph Bloggs' description
      , '[email protected]' email_address
      , 'June 15 rev:SEPT REV 051214; jun15 rev' fax
      , 77778899 person_party_id FROM DUAL)
SELECT * FROM tbl_data;

USER_NAME    USER_ID DESCRIPTION   EMAIL_ADDRESS                    FAX                                    PERSON_PARTY_ID
--------- ---------- ------------- -------------------------------- -------------------------------------- ---------------
ZZZAAAB        12345 Joseph Bloggs [email protected] June 15 rev:SEPT REV 051214; jun15 rev        77778899
1 row selected.

I can't get around the selection of data from tables, thanks to the design of the table?

Hello

You need to change the columns for output. For example:

User_name FORMAT A20 COLUMN

COLUMN user_id FORMAT 9999999999

....

Tags: Database

Similar Questions

Maybe you are looking for