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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The following sql produces the o/p

Status
Not open for further replies.

IMAUser

Technical User
May 28, 2003
121
CH
The following sql produces the o/p where u see a lot of blanks.

select 'z' from dual;

'Z'
--------------------------------
z

What I really want the o/p to be

'Z'
-
z

Is there an option to set so that the o/p width is what the heading width is and not add any extra blanks.

I know the column option on SQL*Plus, but thre you got to define all the columns and ther o/p formats. I want something more generic, something at system level.

Thanks

 
How about

[tt]SELECT rtrim('z ') z from dual;

Z
-
z

1 row selected.[/tt]
 
Well,
I connect to the same database first by SQL*Plus on NT and then by SQL*Plus on Solaris. And the stmt select 'z' from dual results in

On NT
Z
-
z

On UNIX
'Z'
--------------------------------
z

Any clues why this could be the case.

Same user same database on both queries.

Thanx,
 
I can't give you an answer, but I did find it interesting that there were 32 or (2[sup]5[/sup]) hypens. What happens if you type:

Code:
SELECT   '123456789012345678901234567890123' 
FROM     dual
 
I tried it on UNIX (Solaris 8) and W2K with 8.0.6-9.2 and found no difference. My assumption is that on Unix you have some uncleared column definition named Z set from [g]login.sql or some other script launched before.
Another possible reason is side effect from using CURSOR_SHARING=FORCE (also changed from [g]login)

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top