Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redundant blank line generated 1

Status
Not open for further replies.

vinczej

Programmer
Apr 29, 2003
40
0
0
HU
Hi All!

I have this sample sql:

with p_1 as
(
select 1 sorszam, 'X1' tipus from dual
union all select 2 sorszam, 'X2' tipus from dual
union all select 3 sorszam, 'X3' tipus from dual
)
select (
(case when p1.sorszam=1 then ('[' || chr(13) || chr(10)) else '' end) ||
p1.tipus
|| (case when p1.sorszam=(select max(sorszam) from p_1) then (chr(13) || chr(10) || ']') else '' end)
) szoveg
from p_1 p1
order by p1.sorszam
;

The result is:

SZOVEG
--------
[
X1

X2
X3
]

My question is: Why is generated the blank line after the first line? Thanks forward!
 
Actually you have got two redundant blank lines.[wink]
The other one is at the very end.

That's a feature of sqlplus output:
Whenever an ouput line is split across several lines, the next line will be left blank for better readablity.
If this behaviour is undesired, you may switch it off with this sqlplus command:
set recsep off

regards
 
Thanks, hoinz! I will try tomorrow your suggestion. [bigsmile]
 
Thanks for the suggestion! "Set recsep off" is working perfectly! [bow]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top