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!

SQL Plus doesn't RPAD

spalato76Dec 20 2010 — edited Dec 20 2010
Hi All,

I'm running into a peculiar problem where I'm trying to pool an oracle table that has about 30 million records into a text file. I'm using Toad for Oracle version 10.5. When I spool my results, I'm rpading a column to 54 characters with blank spaces. When I run this spool as a script in Toad or using Toad's Quest Script Runner it pads it no problem but when I try doing it through the "Execute SQL via SQL Plus" command in Toad it doesn't do the rpading. I don't get it. Anyway, here's the script...just removed the name of my table and column names and replaced them with more generic names:

Spool on
set heading off
SET PAGESIZE 0
SET TRIMSPOOL ON
SET LINESIZE 100
set feedback off
set echo off
set termout off
Spool "C:\test.txt"
select
rpad(column1,54) as column1
from crg_input_final
where rownum <=100
order by
column2,
column1;
Spool off;

I always assumed that SQL is SQL...no matter if you run it in Toad or SQL Plus or wherever. Am I missing something?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2011
Added on Dec 20 2010
3 comments
665 views