Home » SQL & PL/SQL » Client Tools » remove spaces (4 Merged) (SQLPLUS)
remove spaces (4 Merged) [message #563536] Tue, 14 August 2012 12:37 Go to next message
ollivier
Messages: 19
Registered: January 2012
Location: chihuahua
Junior Member
Hi:
I have a little problem, using SQLPLUS I use "set linesize 300", so in the END of outputfile file
I got spaces after info ! I mean

select client_id || ';' || date || ';' || amount info
from table

1;FEB-2012;5000........
2;DIC-2011;10000.......
500;MAR-2012;300000.... (. = spaces)

How I remove spaces after Data ?
Thanks a Lot !
Re: remove spaces [message #563540 is a reply to message #563536] Tue, 14 August 2012 12:52 Go to previous messageGo to next message
BlackSwan
Messages: 23151
Registered: January 2009
Senior Member
>How I remove spaces after Data ?
TRIMSPOOL or RTRIM

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: remove spaces (4 Merged) [message #563542 is a reply to message #563536] Tue, 14 August 2012 13:02 Go to previous messageGo to next message
Michel Cadot
Messages: 59994
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SET TRIMOUT ON
SET TRIMSPOON ON

Always set them to ON in your login.sql or glogin.sql and set them to OFF in your script when you want fixed length output.

Regards
Michel
Re: remove spaces (4 Merged) [message #563547 is a reply to message #563542] Tue, 14 August 2012 13:23 Go to previous messageGo to next message
ollivier
Messages: 19
Registered: January 2012
Location: chihuahua
Junior Member
Thanks a Lot !

Just is reverse ! SET TRIMSPOOL OFF - login.sql
and SET TRIMSPOOL ON - in_your_sript.sql

Re: remove spaces (4 Merged) [message #563554 is a reply to message #563547] Tue, 14 August 2012 13:45 Go to previous message
Michel Cadot
Messages: 59994
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is better to set it the opposite as you have more often the usage to trim your output than to not trim it.
Unfortunately, Oracle set them to OFF by default.

Regards
Michel
Previous Topic: Handling DATETIME format using SQLPLUS COPY command
Next Topic: excel & oracle database
Goto Forum:
  


Current Time: Sat Dec 20 04:10:54 CST 2014

Total time taken to generate the page: 0.08650 seconds