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 eliminate blank line in sqlplus output

vxwo0owxvDec 8 2011 — edited Dec 8 2011
#!/bin/ksh

#Hi I am doing a data extract using sqlplus but the output has a blankline in it.
#How I ask sqlplus to not putting that blankline. Thanks so much for the kind help

mydate=`date '+%m%d%Y'`

file_ext=".txt"
file_hdr="testlinespace"
OUTFILE=`echo $file_hdr$mydate$file_ext`
echo $OUTFILE

mytime_start=`date '+%Y%m%d_%H%M%S'`
echo $mytime_start

sqlplus -silent /nolog << EOF
CONNECT scott/tiger@orc1.world

set echo off
set colsep ' '
set pagesize 0
set trimspool on
set headsep off
set linesize 100
set pagesize 50
set heading off
set feedback off
set timing off
set time off
set termout off
set headsep off

spool $OUTFILE


WITH a1 as
(
SELECT object_id,object_name from all_objects
)
SELECT * FROM a1 where rownum < 1001;



spool off

select to_char(sysdate,'YYYYMMDD_HH24MISS') from dual;

exit
$

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 5 2012
Added on Dec 8 2011
1 comment
17,938 views