sqlplus output format [message #518705] |
Fri, 05 August 2011 09:19 |
dba_7722
Messages: 197 Registered: August 2010 Location: Delhi
|
Senior Member |
|
|
Hello Expert,
After restart of the instance, developer are complaining that sqlplus output is changed from the database.
After the restart,when it came back most of the scripts that the user are running started having problem like the one bellow.
The user reported that all the selects are adding space to each column
Like if you do
Set colsep ','
select '11111','222222' from dual
It does result
11111 ,222222
Please suggest, what could be reason for the same.
Thanks
Jay vardhan
|
|
|
|
|
|
|
|
|
|
Re: sqlplus output format [message #518936 is a reply to message #518931] |
Mon, 08 August 2011 08:25 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If you tell sqlplus to format columns called a and b then you need to have the query return columns called a and b.
See the aliases in Michel's example.
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: sqlplus output format [message #518987 is a reply to message #518985] |
Mon, 08 August 2011 12:47 |
dba_7722
Messages: 197 Registered: August 2010 Location: Delhi
|
Senior Member |
|
|
Hello,
Thanks expert for so long support. Issue solves after changing the parameter. Here is the demo:
SQL> show parameter cursor_sharing
NAME TYPE
------------------------------------ --------------------------------
VALUE
------------------------------
cursor_sharing string
FORCE
SQL> set colsep ','
SQL> select 'jay','suhel' from dual;
'JAY' ,'SUHEL'
--------------------------------,--------------------------------
jay ,suhel
SQL> alter session set cursor_sharing='EXACT';
Session altered.
SQL> show parameter cursor_sharing
NAME ,TYPE ,VALUE
------------------------------------,-----------,------------------------------
cursor_sharing ,string ,EXACT
SQL> select 'jay','suhel' from dual;
'JA,'SUHE
---,-----
jay,Suhel
thanks a lot for your support.
Jay vardhan
|
|
|
Re: sqlplus output format [message #518994 is a reply to message #518987] |
Mon, 08 August 2011 13:18 |
|
Michel Cadot
Messages: 68733 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:Issue solves after changing the parameter. Here is the demo
You should FIRST know why this parameter was set.
Changing it will change the behaviour of the applications.
Take care!
Regards
Michel
|
|
|