SQL Plus Text is wrapping after 80 characters.

The following is the sql I am using to spool the data into a file. However, I am confused with the output. The text is wrapping after 80 characters and it is adding blank lines after each column in the select. Am I missing some thing here. I appreciate your help.
set echo off
set feedback off
set termout off
set heading off
set verify off
set pages 0
set long 20000
set linesize
clear columns
spool /opt/consort/hari/hl7_msgs_533.txt
select rtrim(msh_seg) ||
rtrim(pid_seg) ||
rtrim(pv1_seg) ||
rtrim(orc_seg) ||
rtrim(zri_seg) ||
rtrim(obr_seg),
segment_value
from hl7_msgs where message_id = 1;
spool off;
Here is the output.
PID|1|007985541|007985541||MOORE,WILLIE,||11-JAN-90|M|||3000 DOLFIELD AVE^^TAL
TIBORE^CP^21215||(510) 766-7000||||BAP||100-10-1000||||||||||||^M
PV1|1 |I|ICU^S412^A||||JAKOBOVITS,JULIAN,MD,MD|,,,||MED|||||||JAKOBOVITS,JULIA
N,MD,MD|I ||||||||||||||||||0 ||||||||09-NOV-97|18-NOV-97||||||||^M
ZRI|1 |LIBRARY GROUP|FILE RM|FILE RM|10-NOV-97||S412|||RAD|^M
OBX|1 |TX|ULT00004^VENOUNI/US^VENOUS IMAGING WITH DOPPLER|||~~RIGHT LOWER EXTR
EMITY VENOUS DOPPLER SONO, 11-10-97, -8965~CLINICAL INDICATION: cellulitis, r/o
DVT~~The right common femoral vein, superficial femoral vein and popliteal veins
were scanned using color flow, duplex and B-mode scanning. The veins were comp
ressible and showed spontaneous flow which augments normally with compression of
the calf.~~IMPRESSION:~~No evidence of deep venous thrombosis in the right femo
ral and right popliteal veins. ~~ ||||||F ||||784|CAMP,LIBA,DD,CD||^M
OBR||9711102125132|35|ULT00004^VENOUNI/US^VENOUS IMAGING WITH DOPPLER|||10-NOV-9
7|10-NOV-97||||||||JAKOBOVITS,JULIAN,MD,MD||||||12-NOV-97|||||||||DOPPLER FLOW S
TUDIES OF R LEG R\O DVT|CAPITAL,SUSAN,CD,|||FORD,VONDA,SKETERS,|||||||||^M
~******************************************
~
~

It still wraps up the output.
You may have embedded carriage returns in your columns.
Let me explain you with an example.
SQL> create table mytable(col1 varchar2(80));
SQL> insert into mytable
  2  select lpad('ab',80,'cd') from dual;
1 row created.
SQL> select lpad('ab',50,'cd')||chr(10)||lpad('ab',29,'cd') from dual
  2 
SQL> insert into mytable
  2   select lpad('ab',50,'cd')||chr(10)||lpad('ab',29,'cd') from dual;
1 row created.
SQL> select * from mytable;
COL1
cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdab
cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdab
cdcdcdcdcdcdcdcdcdcdcdcdcdcab

Similar Messages

  • Oracle 9i Lite/Sql Plus Installation Instructions?

    I am having the same problem with install Oracle 9i Lite. Really I need to get SQL PLUS up and running. I am installing it in Windows 98 and would like to use it on a stand alone pc/home pc.
    I ended up just installing sql plus without net8 and other mobile server components because I don't know what the port name and hostname is. I am just trying to get sql plus to work.
    After just installing sql plus, I get the same login username/password/host string. I think you can log in as SYSDBA or SYSOPER but what is the password and host string. I am not running sql plus from a server/internet I would like it to be stand alone. I know the host string has something to do with what type connection is being used but I don't have any (other than aol dial up connection) so I would just like to run sql on a stand alone pc!!! HELP!!
    Dionne

    Did your SQL*Plus install include create a database to connect to? I think a quick thing to check would be:
    Do you have a valid tnsnames.ora in $ORACLE_HOME\network\admin
    (address = is on one line)
    ie:
    orcl =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = orcl.localhost)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = orcl.localhost)
    Where orcl is the name of the database you want to connect
    to and local host is your machine. (Check Network configuration). If you are on a network you will replace with orcl.mynet.com
    I think for a standalone SQL install they might expect you are on a NetWork and have a database to connect to. Maybe
    you should download the whole install for standalone use...
    9i and 8.1.7 are available for download. (8.1.7 is a little smaller and doesn't require as much memory depending on your home system)
    I'm not even sure what you are trying to do. Please post more details if this doesn't help.

  • SQL*PLUS Worksheet Width

    I'm (bery) new to Oracle. I'm trying to figure out how to make the output results of a select statement in SQL*Plus Worksheet not wrap. Is there a way to do this?
    Thank you
    JohnD

    hi friends,
    I have used SET LINESIZE 1000 to increase width and display all column details in a row.
    But now it is not scrolling till the last column details displayed on screen.Suppose there are 12 columns in my table and i could see only 8 which are displayed on my screen.
    How can i scroll to right till the last column?
    Thank you,
    Regards,
    Raghv

  • SQL*PLUS is wrapping text

    When I execute commands in SQL*PLUS, it is only using half of the screen and wrapping the data to the next line. Even a table that has only 4 columns of data gets wrapped so the screen looks messy and is difficult to read.
    I went to Options and Buffer Width and changed it to 1000 and nothing happened. Is there any other changes I can make?
    Thanks!!

    You'll probably need to set the linesize as well.
    SET linesize 1000

  • Chinese Characters in SQL Plus

    Hi, I wonder how do I input the chinese characters in SQL plus? I have set the NLS_LANG value to chinese characterset in the REGEDIT but it doesn't display the chinese characters. Is there any chinese version on Oracle JDeveloper Suite?
    Cheers

    i have installed sqlplus and oracle db in the same PC under chinese win xp.
    i found that if you spool the output to a text file, and type in dos-prompt, it still cannot display the chinese character properly. but if you open the text file by notepad, bingo, you can the chinese character.
    i think that it is because dos-prompt application is non-unicode application. so it could not display unicode character properly.
    as a result, if you want to display unicode character in non-unicode application (run sqlplus under dos-prompt), you have to set the NLS_LANG environment variable which match the character set of non-unicode application which your operating system assigned. in my case, it should be Big5. then oracle would do the conversion for you automatically, i.e. from unicode in DB to Big5 in client.
    I either set the NLS_LANG environment variable in one of the 2 ways:
    NLS_LANG=american_america.zht16big5 or
    NLS_LANG=american_america.zht16hkscs
    Regards,
    KH

  • Copying text in Sql*Plus

    I seem to be unable to copy and paste text using the "highlight text and right-click" procedure in Sql*Plus 8.0.6.0.0. The right-mouse button seems to work in everything else so it doesn't seem to be the mouse that is the problem. Does anybody know if this could be due to the way Sql*Plus is set up or some other Oracle related problem?

    You can either do SET PAGESIZE 0 which turns off all headings.
    Of you can do SET PAGESIZE 50000 which will reprint the headings every 50,000 lines.
    50,000 is the max. I don't know of a way to show the headings once, and only once. (you can turn off headings and fake them one time with a select ... from dual before your main query).

  • SQL*Plus: list of characters that need to be escaped

    Hi all,
    We have a requirement where we need to add comments to tables and table columns and this is done using SQL*Plus. I understand that there are some special characters that are interpreted by SQL*Plus such as ampersand (&). I would like to know the list of such characters so that we can escape them before passing it on to CREATE COMMENT ON statement. So far we have identified the following special characters:
    The following characters need to be escaped no matter where they are present in the comment
    single quote "'" (hex 27)
    define "&" (hex 26)
    sqlterminator ";" (hex 3b)
    The following characters need to be escaped when they are the only character on a line
    forward slash "/" (hex 2f)
    blockterminator "." (hex 2e)
    sqlprefix "#" (hex 23)
    The following characters need to escaped if they are followed by a newline
    line continuation "-" (hex 2d)
    We would like to know if there are other special characters and appreciate if someone can provide the list.
    Thanks
    Edited by: user779842 on Aug 20, 2009 3:37 AM
    Edited by: user779842 on Aug 20, 2009 3:55 AM

    I think the only two characters you need to worry about in your comment strings are: ' and & (apostrophe/single quote and ampersand). The latter you can get around by doing:
    set define offbefore running your statements, but the apostrophe you'll have to double up to allow oracle to recognise that it's not the end of the string. Eg:
    I'm a stringwould become
    'I''m a string'  -- NB. this is two single quotes, not 1 double quote!or, if you're on 10g or above, you can use the quote operator (q):
    select q'#I'm a string#' from dual;See the documentation for what characters can be used as the quote delimiters: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_sqltypes.htm#sthref377

  • Displaying Chinese characters in SQL*Plus

    DB version: 11.2
    OS Version : AIX 6.1
    DB characterset:AL32UTF8
    To display chinese characters in SQL*Plus, I did the following:
    $ export LANG=zh_CN.UTF-8
    $ export LC_ALL=zh_CN.GB2312
    $ export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
    $
    $ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.2.0 Production on ÐÇÆÚÈý 5ÔÂ 2 15:52:33 2012
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning option
    SQL> ALTER SESSION SET NLS_LANGUAGE='SIMPLIFIED CHINESE';
    Session altered.
    SQL> ALTER SESSION SET NLS_TERRITORY='CHINA';
    Session altered.
    SQL> select unistr('\8349') from dual;  ---- not 100% sure if this is the way to verify if chinese characters can be displayed.
    UN
    ²Ý                 ----------------------------------------> Getting a junk character instead of chinese If I was using putty, are the above steps enough to get chinese characters displayed ?
    Our ssh client is Tectia (not putty).
    According the below ML Note, the SSH client has to configured correctly to use globalization features.
    +The correct NLS_LANG setting in Unix Environments [ID 264157.1]+
    Googling "Tectia + Chinese" didn't return useful results

    I understand that you are talking about Windows SSH Client.
    For Putty, you should set:
    $ export LANG=zh_CN.UTF-8
    $ export LC_ALL=zh_CN.UTF-8
    $ export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
    and configure Putty in Window->Translation to use UTF-8.
    There is nothing about this subject on Tectia website and in their manuals, so my best guess is that the client requires Windows code page to work correctly. In such case you need to set your Windows system default locale (locale for non-Unicode programs) to Chinese and use the following settings on the server:
    $ export LANG=zh_CN.GBK
    $ export LC_ALL=zh_CN.GBK
    $ export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
    Verify with 'locale -a' that the setting zh_CN.GBK is supported on your system.
    -- Sergiusz

  • INSERTing chinese characters in SQL*plus

    Db version: 10gR2
    NLS_NCHAR_CHARACTERSET for my DB is AL16UTF16 by which i can store chinese characters. To INSERT using SQL*Plus, i tried to copy and paste some chinese characters from internet. When the characters get pasted, it becomes '?????' (question marks). What else do i have to set to store Chinese characters?
    SQL>  CREATE TABLE EMP2
      2   (EMPNO NUMBER,
      3   ENAME NVARCHAR2(500));
    Table created.
    SQL> Insert into emp2(empno,ename) values(889,UNISTR('????'));
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> SELECT * FROM EMP2;
         EMPNO ENAME
           889 ????

    Actually, it looks like Forums do something strange to URLs pasted into posts. Sorry!
    The thread URL is Re: store/retrieve data in lang other than eng when CHARACTERSET is not UTF8

  • Issue with Taiwanese characters display in SQL*Plus/Toad

    Hi all,
    I have an issue about displaying the Taiwanese characters either in SQl*Plus or Toad tool. Able to view all territory characters properly except it. Whenever i tried to view these characters from Toad, diplay like square box('⃞'), where as it displays as question mark ('?') from SQL*Plus.
    I am not sure what are the parameters i want to alter. Please have a look at the below existed database parameters in the DB and help me to get rid of the issue.
    PARAMETER     VALUE
    NLS_LANGUAGE     AMERICAN
    NLS_TERRITORY     AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY     AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CHARACTERSET     AL32UTF8
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     DD-MON-RR
    NLS_DATE_LANGUAGE     AMERICAN
    NLS_SORT     BINARY
    NLS_TIME_FORMAT     HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT     HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY     $
    NLS_COMP     BINARY
    NLS_LENGTH_SEMANTICS     BYTE
    NLS_NCHAR_CONV_EXCP     FALSE
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_RDBMS_VERSION     10.2.0.4.0
    Oracle DB banner:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
    NLSRTL Version 10.2.0.4.0 - Production
    Your help would be appreciated!!
    Thanks in advance.
    vissu

    vissu wrote:
    Hi all,
    I have an issue about displaying the Taiwanese characters either in SQl*Plus or Toad tool. Able to view all territory characters properly except it. Whenever i tried to view these characters from Toad, diplay like square box('⃞'), where as it displays as question mark ('?') from SQL*Plus.
    I am not sure what are the parameters i want to alter. Please have a look at the below existed database parameters in the DB and help me to get rid of the issue.
    PARAMETER     VALUE
    NLS_LANGUAGE     AMERICAN
    NLS_TERRITORY     AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY     AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CHARACTERSET     AL32UTF8
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     DD-MON-RR
    NLS_DATE_LANGUAGE     AMERICAN
    NLS_SORT     BINARY
    NLS_TIME_FORMAT     HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT     HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY     $
    NLS_COMP     BINARY
    NLS_LENGTH_SEMANTICS     BYTE
    NLS_NCHAR_CONV_EXCP     FALSE
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_RDBMS_VERSION     10.2.0.4.0
    Oracle DB banner:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
    NLSRTL Version 10.2.0.4.0 - Production
    Your help would be appreciated!!
    Thanks in advance.
    vissuHow was this data loaded into the database ? If SQL Developer is showing incorrect data, then the data was not loaded correctly into the database and has been corrupted - in such a case, NLS_LANG will not help
    Srini

  • Can v read a client text file using SQL*plus??

    We have a requirement like this: We need to read a text file to find spelling mistakes. Problem is the file has to be always moved to the DB machine, which is a Linux box and then run a stored procedure which uses UTL_FILE. Now in order to show the spelling mistakes of the file the user will have to again copy the file with the spelling mistakses (output file) from Linux to Windows.
    Is there a way to do it using SQL*Plus, where the text file is in the client machine???? Then users don't have to copy the file to and from the Linux box.

    SQL*Plus is a client software and whatever code you write using SQL*Plus, it ultimately run on the server. So the answers to your question is "no".

  • SQL * PLUS WORKSHEET wrapping

    I am using the SQL*Plus: Release 8.1.6.0.0 and the query gives us a wrapping results which is so hard to read and takes awhile to execute.

    The default value for SQL*Plus LINESIZE is 80 and for PAGESIZE is 25. If the row of records select increases 80 then the records start wrapping. The suggestions are
    1>. either limit the columns selected. i.e. instead of using SELECT * from TABLE use
    SELECT col_a, col_b ... from TABLE
    2>. increase the linesize by using the following
    SET LINESIZE 300 ;
    The valid values for linesize are 0 through 32767.
    However, if you increase the linesize to a very high value, then you will need to do horizontal scroll to see all the columns.

  • Issues trying to Access SQL Plus after downloading 8i Trial Version

    After successfully downloading Oracle 8i Personal Edition, I am trying to access SQL Plus, it requires to enter a User Name, Password and Host String. I enter my OTN Password ID and I am refused access. Does anyone have any ideas why?

    harry,
    i am assuming you are using 6.0.8.8 of reports6i, which is base-release. there have been problems withthe OCA in this version. by using the latest patch you should solve this problem. for further details, please contact oracle support services.
    regards,
    the oracle reports team

  • Insert more than 4000 characters using sql plus

    I have a SQL script that creates a database. The problem is that some of the fields are longer than 4000 characters in the INSERT statement and Oracle doesn't seem to like it.
    The field is a clob and works fine in the application (i.e. I can insert more than 4000 characters using the app) - how do I achieve this in a SQL script?
    Any help is much appreciated.
    Cheers,
    Steve

    Hi,
    This pl/sql block works absolutely fine in SQL*Plus inserting > 4000 characters into clob column:
    declare
    l_str varchar2(8000);
    l_str1 varchar2(2400) := 'first part of the verly long string...';
    l_str2 varchar2(2400) := 'second part of the verly long string...';
    begin
    l_str := l_str1 || l_str2;
    insert into tmpl values (l_str);
    end;
    So, you'll have to replace inserts with pl/sql blocks in your script.
    Tested in Oracle 8.1.7.0.0
    Regards,
    Andrew Velitchko
    BrainBench MVP for Developer/2000
    http://www.brainbench.com

  • Input truncated to 3 characters in Sql*Plus

    Hi All,
    I ran .sql script in SQL*PLUS but i got one error.
    error is Input truncated to 3 characters.
    pls help me..

    Hi,
    Read > this one.
    Twinkle

Maybe you are looking for

  • Can't install pse10 on mac 10.6.8

    I put in the cd from adobe (1 of 3) and it shows in the finder, but doesn't open an install screen.  So, I go into finder and clickon the exe file, and it just opens iphoto.  What is going on?  Can someone help me?

  • Latest Premiere Pro CC update (7.1.0) may be the buggiest yet?

    I have been using Premiere for thirteen years and the latest update 7.1.0 (141) is perhaps the buggiest most frustrating yet. The list off annoying issues is long. Today I will start writing them down so I can be more spicific in my next post. I just

  • Quantity mismatch in BOM

    Hi Guys, I have Configured a BOM as pricing on main item(Erla). But when i am trying to change the quantity in delivery the sub item Quantity doesnt changes. For eg: If in order i have ordered 5 quantity, So the bom is getting exploded with a right q

  • Transitions in Premiere Pro CC not working

    After upgrading from PP CS6 to PP CC on a Mac, the audio and video transitions do not work.  I've tried dragging them in and using the keyboard shorcuts to no avail.  All apps are updated as well.  Suggestions?

  • Where is the GPS data in Bridge?

    Shot 93 today and have GPS data in camera but can't find how to view GPS data in Bridge. I have selected show GPS data in Preferences but no data is showing up. Any ideas?