RE: Really annoying change to 11.2 sqlplus

  • From: Yong Huang <yong321@xxxxxxxxx>
  • To: Michael Moore <michaeljmoore@xxxxxxxxx>, MarkBobak <Mark.Bobak@xxxxxxxxxxxx>
  • Date: Fri, 25 Feb 2011 13:35:35 -0800 (PST)

I think you're right:

$ cat qwer.txt #a file created on Windows scp'ed to Linux (scp preserves all 
chars)
x
y
z
$ od -x qwer.txt #read it as: 78, D, A, 79, ... on littel-endian arch
0000000 0d78 790a 0a0d 0d7a 000a
0000011
$ perl -pi -e '$x=chr(10);s/$x//g' qwer.txt #remove 0xA (i.e. line feed)
$ od -x qwer.txt #verify
0000000 0d78 0d79 0d7a
0000006
$ cat qwer.txt #the three letters "disappeared"
$

Windows command console (DOS) has the same "problem":

C:\>pscp oracle@thelinuxbox:qwer.txt .
...
C:\>od -x qwer.txt
0000000 0d78 0d79 0d7a
0000006
C:\>type qwer.txt

z


Instead of showing nothing, it shows the last character here. But in short, we 
should not blame the console version Sqlplus, but the console itself.

Fortunately, systems only using 0xD (carriage return) are becoming rare 
nowadays, such as "Mac OS up to version 9 and OS-9". See
http://en.wikipedia.org/wiki/Linefeed

Yong Huang

--- On Fri, 2/25/11, Bobak, Mark <Mark.Bobak@xxxxxxxxxxxx> wrote:
Isn’t that just a side-effect of the way unix/Linux handle carriage returns and 
line feeds?  If you replace chr(13) w/ chr(10), you may get what you were 
expecting:SQL> select 'x'||chr(13)||'y'||chr(13)||'z' from dual;  'X'||-----z  
SQL> c/13/10  1* select 'x'||chr(10)||'y'||chr(13)||'z' from dualSQL> c/13/10  
1* select 'x'||chr(10)||'y'||chr(10)||'z' from dualSQL> /  'X'||-----xyz  From: 
oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf 
Of Yong Huang
Sent: Friday, February 25, 2011 1:40 PM
To: Michael Moore
Cc: steve.harville@xxxxxxxxx; oracle-l@xxxxxxxxxxxxx
Subject: Re: Really annoying change to 11.2 sqlplus  Vertial select is 
available in console (DOS) version of Sqlplus too. If you haven't enabled 
QuickEdit mode, you have to go to Edit->Mark every time you want to select.

Addition to my last message. sqlplus in UNIX/Linux terminal may also suffer 
from the problem of characters disappearing when multiple chr(13) are in the 
output, e.g.

$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Fri Feb 25 10:09:47 2011
...
SQL> select 'x'||chr(13)||'y'||chr(13)||'z' from dual;

'X'||
-----
z

Yong Huang

--- On Fri, 2/25/11, Michael Moore <michaeljmoore@xxxxxxxxx> wrote:Also in the 
old win SQLPLUS you could highlight a column in the middle of the window and 
copy it. That was very useful.Mike  


      

Other related posts: