RE: Really annoying change to 11.2 sqlplus
Date: Fri, 25 Feb 2011 13:35:35 -0800 (PST)
Message-ID: <303739.49663.qm_at_web80603.mail.mud.yahoo.com>
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_at_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_at_proquest.com> 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_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Yong Huang Sent: Friday, February 25, 2011 1:40 PM To: Michael Moore Cc: steve.harville_at_gmail.com; oracle-l_at_freelists.org 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_at_gmail.com> 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 -- http://www.freelists.org/webpage/oracle-l