Carriage Return in Oracle

I'm writing a to file and need to add a Carriage Return/New Line after every line. I've tried CHR(10) and CHR(13) and when opened in a Windows environment they both display an unrecognised character.
Has anyone come across a similar problem or know what I'm doing wrong with this?
Thanks
Jay

hello
you need append both characters to the end of the line chr(13)||chr(10) not chr(10)||chr(13). 13 is carriage return, 10 is line feed and they are both needed on windows.
hth

Similar Messages

  • Oracle Reports 6i Delimied Format and Carriage Returns

    Hi
    I'm using Oracle Reports 6i to generate a report to a text file using delimited format so I can read it in Excel. I've done some testing putting some information in the layout but it seems that all my data is generated in one line. It does not generate the carriage return for the multiple rows I need. Is this standard functionality?. If so, that means I have to generate the file using PL/SQL to get the control I want?

    Whew...lot's of questions...let's see if I can help (at least a little)...
    1. Quite possibly, the user is/was pulling the image from the database? I do this in my environment, so it might be worth a look.
    2. You should be able to print in any format from the web. You may need to adjust your destype/desname/desname parameters.
    3. Only thing I can think of here is that maybe the original report was not written using a standard web-friendly font?
    4. There's a couple of ways you can get data into an excel file:
    A. Use DDE and poke the data right into it (messy when you need to print the regular Oracle report too).
    B. Add an option to print to file and set the desformat to DELIMITEDDATA. Be sure to go through the data model and set Exclude from XML Output to 'Yes' for fields you don't need. Also, be aware that this may not come out in the same order as they do on the printed report. You can read about this on Metalink.
    Hopefully that helps you a little bit. :)
    Chad

  • Remove carriage returns from a field in an oracle table

    I have a field that is defined as a LONG in my oracle table; the data contained in this field has carriage returns/line feeds (it's free form text); as i'm selecting data from this field, i need the carriage returns removed so that the data from this field all appears on one line.
    I tried using the TRANSLATE function to convert the carriage returns to something else, but that doesn't work.
    Example:
    Select comment from Notes:
    COMMENT
    the applicant called for an appointment;
    an exam was scheduled for 4/1/05 at 9am;
    called applicant to confirm app
    this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled for 4/1/05 at 9am; called applicant to confirm app"
    How can i do this? Can the decode function be used to remove the carriage returns in this field?

    when i used translate its giving correctly,
    SQL> ed
    Wrote file afiedt.buf
    1 select translate('the applicant called for an appointment;
    2 an exam was scheduled for 4/1/05 at 9am;
    3 called applicant to confirm app
    4 this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled
    5 How can i do this? Can the decode function be used to remove the carriage returns in this field
    6* ',' ') from dual
    SQL> /
    TRANSLATE('THEAPPLICANTCALLEDFORANAPPOINTMENT;ANEXAMWASSCHEDULEDFOR4/1/05AT9AM;CALLEDAPPLICANTTOCONF
    the applicant called for an appointment; an exam was scheduled for 4/1/05 at 9am; called applicant t
    SQL> ed
    Wrote file afiedt.buf
    1 select 'the applicant called for an appointment;
    2 an exam was scheduled for 4/1/05 at 9am;
    3 called applicant to confirm app
    4 this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled
    5* How can i do this? Can the decode function be used to remove the carriage returns in this field
    SQL> /
    'THEAPPLICANTCALLEDFORANAPPOINTMENT;ANEXAMWASSCHEDULEDFOR4/1/05AT9AM;CALLEDAPPLICANTTOCONFIRMAPPTHIS
    the applicant called for an appointment;
    an exam was scheduled for 4/1/05 at 9am;
    called applicant to confirm app
    this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled for 4
    How can i do this? Can the decode function be used to remove the carriage returns in this field?
    SQL>

  • Exporting Text data from PHP to Oracle CLOB data (Carriage return - issue)

    This is my original text content in PHP - Data type - Longtext
    SECTION - 1
    This a test description.This a test description.
    This a test description.This a test description.
    This a test description. This a test description.I exported the above content from PHP as a SQL script file (insert into.. ) - export.sql [ insert into table_name (id, text_content) values (1, '') ]
    while exporting data from PHP table into export file.. it replaced the "Carriage return" with "\r\n\r\n" in the insert statement for text_content column
    When I run this INSERT statement in Oracle (for longtext, I have created a CLOB column in Oracle), the following text_content data is inserted into CLOB column in Oracle.
    SECTION - 2
    This a test description.This a test description.\r\n\r\nThis a test description.This a
    test description.\r\n\r\nThis a test description.This a test description.Now I have created a item named P1_TEXT_CONTENT of type TEXTAREA and try to fetch the CLOB data into this page item.
    BUT textarea displays the entire content including "\r\n\r\n" as mentioned in SECTION - 2
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?
    Thanks,
    Deepak

    DeepakJ wrote:
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?Run an update on the Oracle table following the inserts to replace the escaped CR/LFs with real ones:
    update foo
    set clob_column = replace(clob_column, '\r\n', chr(13) || chr(10));You might want to experiment to see which characters are actually necessary. As an OS X/Linux user I'd probably just use a single LF chr(10).

  • SQL Loader - Loading Text File into Oracle Table that has carriage returns

    Hi All,
    I have a text file that I need to load into a table in Oracle using SQL Loader. I'm used to loading csv or comma delimited files into Oracle so I'm not sure what the syntax is when it comes to loading a text file that essentially has one value per row and each row is separated by a carriage return. So when you open the text file, the records look like this:
    999999999 <CRLF>
    888888889 <CRLF>
    456777777 <CRLF>
    456555535 <CRLF>
    345688888 <CRLF>
    So each row is separated by a hard return and I need to tell sql loader that the hard return or next row is the next value to insert into the table. Below is an example of a control file I tend to use as a template for loading csv files but I need to modify it to accomodate this new structure.
    OPTIONS (DIRECT=TRUE,ROWS=100000)
    UNRECOVERABLE
    LOAD DATA
    INFILE 'C:\input.txt'
    BADFILE 'C:\input.bad'
    APPEND
    INTO TABLE TEST_TABLE
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    COLUMN_1
    How to I modify the control file above to use hard returns as the field/row delimiter for my text file?
    Thanks

    Hi there,
    Obviously my intention wasn't to post the same message 4 times....I pressed the "Submit Message" button but the submission hung and I pressed it a few times and finally it worked but it created several versions of my post. You need to allow users the ability to delete there own postings...I was looking for this option but didn't have it.
    Sorry

  • Carriage Returns - Oracle Clinical

    Hi all,
    My company is using Oracle Clinical 4 and there is a problem whereby users are hitting enter at the end of a string of text. This creates a carriage return that cause SQL to think that this means a new line when it spools the output to Excel.
    Is there anything that can be done other than trying to get people to stop hitting enter, which is not possible as the need to for certian comments to make them legible.
    Any advice
    Thanks
    C.

    You can strip out the extra characters in the select statement that you spool for excel. Something like:
    SELECT col FROM (
    SELECT 'This shows on '||CHR(10)||'two lines' col
    FROM dual)
    SQL> SELECT col FROM (
      2  SELECT 'This shows on '||CHR(10)||'two lines' col
      3  FROM dual);
    COL
    This shows on
    two lines
    SQL> SELECT REPLACE(col, CHR(10), NULL) FROM (
      2  SELECT 'This shows on '||CHR(10)||'two lines' col
      3  FROM dual);
    REPLACE(COL,CHR(10),NUL
    This shows on two linesNote that you may also need to strip the linefeed as well. so the replace would be:
    SELECT REPLACE(REPLACE(col, CHR(10), NULL), CHR(13), NULL)HTH
    John

  • Losing carriage returns in textarea / using plpdf to generate report

    Hello,
    I'm using Apex 3.1.1 and Oracle 10g database. I would appreciate any suggestions on how I can preserve carriage returns in a textarea when sending the text to a package that generates a report. Please see example of current problem (below code). I'm using an onkeypress function to check for keycode = 13 when the Enter key is pressed -- that is working. I also created an alert to show the url value -- I can see the text on multiple lines, so that appears to be working as well. The textarea value parameter in the package is defined as varchar2. Per the support folks at plpdf.com, chr(13) indicates an explicit line break, and they told me to check my text. I don't know what I'm missing. Thank you for any suggestions you may have.
    Lisa
      function callPLPDFRep()
          var url;
          url = '#OWNER#.' + $x('P&APP_PAGE_ID._REPORT_PROCEDURE').value + '?' + build_params();
          w = open(url, "winPDFRep", "Scrollbars=1, resizable=1, width=800, height=600");
          if (w.opener == null)
            w.opener = self;
            w.focus();
       function build_params()
        var lparms;
        lparms = '';
        lparms = lparms + '&p_incorrect=' + $x('P212_INCORRECT').value;
        lparms = lparms + '&p_correct=' + $x('P212_CORRECT').value;
        return lparms;
      }Text in textarea:
    035 5768 06/15/2010
    035 5768 06/16/2010
    035 5768 06/17/2010
    Printout on report:
    035 5768 06/15/2010035 5768 06/16/2010035 5768 06/17/2010

    Hello Michael,
    Thank you for your response. After doing some researching and experimenting, here's what I have found so far.
    First, using an onkeypress function to alert the keycode, a chr(13) is being returned when I press the Enter key in the textarea.
      function check_Enter(e)
        var keynum;
        var textval = $x('P212_INCORRECT').value;
        if(document.all) 
          keynum = e.keyCode
        else
          keynum = e.which
        alert(keynum);     
      }Next, when I access the value of the textarea via javascript with $x('P212_INCORRECT').value, the chr(13) is automatically converted to the newline character (\n). In an attempt to replace the \n with a \r so plpdf will recognize the carriage return, I added a javascript replace function before sending the text to the package, and it does not work.
      function build_params()
        var lparms;
        lparms = '';
        lparms = lparms + '&p_incorrect=' + $x('P212_INCORRECT').value;
        lparms = lparms + '&p_correct=' + $x('P212_CORRECT').value;
        alert(lparms.split(/\n/g).length - 1);  // confirm that a newline character is found
        lparms = lparms.replace( new RegExp( "\n", "g" ), "\r");  // replace newline character with carriage return
        return lparms;
      }When I tried to replace the newline character (\n) with chr(13), the chr(13) is printed out like it is text instead of a special character. In order to test that I have the correct syntax for the replace function in javascript, I tried replacing \n with '...', and then in the package that generates the PDF, I replaced the '...' with chr(13). That works!
    In response to your comment about the PLPDF procedure for multi line section, I am using: plpdf.PrintMultiLineCell(180, 6, l_incorrect, '0', 0). As a newbie to javascript, I am not sure why replacing \n with \r is not working. Can you advise how to use a chr(13) in the javascript replace function and have it recognized as a special character and not text? I don't know how to view special characters in the textarea other than checking for them with javascript.
    Thanks, Lisa

  • Ignore carriage returns in select statement

    Within Oracle Report builder, I am using a select startment
    select descr
    from atable
    "descr" contains carriage returns at the end of the input ie people have enter 'enter' when inputting the data.
    how do write the select statement to ignore the carriage return 'enter' contain within "descr".
    Thanks

    SQL> SELECT 'aa' || chr(10) || 'bb' c FROM dual;
    C
    aa
    bb
    SQL> SELECT translate('aa' || chr(10) || 'bb', chr(10),' ') c FROM dual;
    C
    aa bb
    SQL> SELECT 'aa' || chr(13) || 'bb' c FROM dual;
    C
    aa
    bb
    SQL> SELECT translate('aa' || chr(13) || 'bb', chr(13),' ') c FROM dual;
    C
    aa bb
    SQL> "For Windows"
    Message was edited by:
    mennan
    Message was edited by:
    mennan

  • Lack of Carriage Returns using XMLForest

    Hi People,
    I'm using Oracle 9i Release 2 (Full Version 9.2.0.6.0), and am experimenting with the XMLforest function and SYS_XMLAGG.
    I'm running a query based on the following table:
    CREATE TABLE test_table(
    job_id NUMBER(10),
    date_created DATE
    INSERT INTO test_table
    SELECT ROWNUM AS job_id,
    SYSDATE
    FROM user_objects
    WHERE rownum < 21;
    COMMIT;
    I'm running the following query against this table:
    SELECT sys_xmlAgg( xmlElement( "JOB", xmlForest(job_id, date_created) ) )
    FROM test_table;
    The data returned by this query is coming out in the following layout:
    <?xml version="1.0"?>
    <ROWSET>
    <JOB><JOB_ID>1</JOB_ID><DATE_CREATED>03/JUN/08</DATE_CREATED></JOB><JOB><JOB_ID>2</JOB_ID><DATE_CREATED>03/JUN/08</DATE_CREATED></JOB><JOB><JOB_ID>3</JOB_ID><DATE_CREATED>03/JUN/08</DATE_CREATED></JOB></ROWSET>
    What I really want (for readability) is for each element to have a carriage return at the end of it, so I get the following:
    <?xml version="1.0"?>
    <ROWSET>
    <JOB>
    <JOB_ID>1</JOB_ID>
    <DATE_CREATED>03/JUN/08</DATE_CREATED>
    </JOB>
    <JOB>
    <JOB_ID>2</JOB_ID>
    <DATE_CREATED>03/JUN/08</DATE_CREATED>
    </JOB>
    <JOB>
    <JOB_ID>3</JOB_ID>
    <DATE_CREATED>03/JUN/08</DATE_CREATED>
    </JOB>
    </ROWSET>
    Is this possible in 9i Release 2, or will I only be able to get the concatenated string?
    How can I force the XML elements to have carriage returns?
    Thanks.
    James

    Bob,
    The string literal 'chr(10)' will not help you much.
    select 'mystring'||'chr(10)'||'mystring' from dual; -- returns 'mystringchr(10)mystring'
    select 'mystring'|| chr(10) ||'mystring' from dual; -- returns 'mystring
    mystring'Cheers,
    Tyson Jouglet

  • Sql Loader and carriage returns

    I am currently trying to use sql loader to load data from flat files that was extracted from sybase using bcp and delimited with pipes. There are text and varchar columns that contain carriage return line feeds. I want to preserve these, but I can not load them into Oracle 8.05 using sql loader as it interprets them as end of record indicators. Does anyone have a way to solve this problem? Any assistance would be appreciated.
    Thanks in advance,
    Jignesh

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • XSLT - New Line/Carriage Return not displaying when deployed

    Hello everyone,
    I have an XSL Style Sheet that is supposed to transform an XML into plain text using Oracle SOA 11g BPEL transformation. The plain text transformation is working fine, but whenever I try to add a new line or carriage return, the text output doesn't reflect that. I've tried several ways of adding the line break but none of them have worked. This is the XSLT I'm using for testing purposes:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:oracle:b2b:X12/V4010/850" version="1.0">
    <xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
    <xsl:template match="/a:Transaction-850">
    <!-- New line -->
    <xsl:variable name='newline'><xsl:text>
    </xsl:text></xsl:variable>
    <xsl:value-of select="a:Internal-Properties/a:Data-Structure/a:Property[@Name='InterchangeUsageIndicator']" />
    <xsl:text>&#xd;</xsl:text>
    <xsl:value-of select="$newline" />
    <xsl:text>&#xA;</xsl:text>
    <xsl:text>&#13;</xsl:text>
    <xsl:text>&#10;</xsl:text>
    <xsl:text>2000ITITM</xsl:text>
    </xsl:template>
    </xsl:stylesheet>
    When I try it out in an online XSLT test tool, it gives the output as expected:
    P
    2000ITITM
    When I deploy the composite, I noticed that the XSLT in the MDS repository ignores the line breaks, *#xAs, etc. and just closes the <xsl:text/> tags:
    <?xml version='1.0' encoding='UTF-8'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:oracle:b2b:X12/V4010/850" version="1.0">
    <xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
    <xsl:template match="/a:Transaction-850">
    <xsl:variable name="newline">
    <xsl:text/>
    </xsl:variable>
    <xsl:value-of select="a:Internal-Properties/a:Data-Structure/a:Property[@Name='InterchangeUsageIndicator']"/>
    <xsl:text/>
    <xsl:value-of select="$newline"/>
    <xsl:text/>
    <xsl:text/>
    <xsl:text>2000ITITM</xsl:text>
    </xsl:template>
    </xsl:stylesheet>
    And so, because of that, it just gives me the following output:
    P2000ITITM
    I have no idea why it's ignoring the new line characters, so any guidance would be appreciated.
    Thank you all for your help and time!
    Edit: I tried concatenating as follows:
    <xsl:value-of select="concat('36','&#xA;')"/>
    <xsl:value-of select="concat('24','&#xD;')"/>
    ...which shows up as is when I look at it in the MDS repository, however the text output still shows no line breaks...
    Message was edited by: dany36

    Ah I'm such a newbie. I was able to get it displayed by doing the following:
    <xsl:variable name="newline" select="'&#xD;&#xA;'" />
    This would show up correctly in the MDS repository, too.

  • Invalid column name - fixed by inserting a carriage return - Why?

    I'm writing some JSP pages and am executing a statement that retrieves values from three tables.
    When executing the statement I receive the error
    java.sql.SQLException: Invalid column name
    I just want to state here that ALL the column names are definitely correct. I attempted to isolate the problem using my SQL*Plus Interface.
    When copying and pasting the SQL that was used (I put the SQL statement into the HTML to allow me to do this) into SQL*Plus it also come up with the error. I found that if I broke up the statement it would run. Specifically if I placed a carriage return (by hitting enter) prior to the 'A' of the AND operator and then copied and pasted into SQL*Plus it would work!
    I thought the problem was related to bad syntax in the outer join operator. But removal of the outer join operator and making it a EQUI JOIN situation still gave the same results. I tried the use of brackets to 'help' the DB engine figure it out - silly I know, but it didn't work anyway :(
    I've tried this out on UNIX in SQL*Plus where the query was on one line and it worked fine. I've tried it on Oracle 8.1.5 SQL*Plus & Oracle 8.1.7 SQL*Plus on Win2000 and WinNT and no go.
    It has also been tested on an Oracle 7.3.4 DB and no go either.
    Remember I'm only using SQL*Plus to find out why it is not working - I'm actually attempting to execute this via JDBC (classes12.zip Oracle9 version) in my JavaBean. I can't place a carriage return to 'fix' the problem, and I'm assuming that I shouldn't either.
    I've pasted the SQL below (both non-working and working versions). I was going to paste the output of DESC on the associated tables should you too would rule out a mispelled column name, but I didn't want to put anyone off with a long post.
    If you can provide any advice I would be very appreciative.
    Darren James
    Show Me Technology
    SQL> SELECT UNIT.Asset_Number,Model,PERSON.Novell_User_Name FROM
    UNIT, UNIT_USERS, PERSON
    2 WHERE UNIT.Hardware_Reference_Number =
    UNIT_USERS.Hardware_Reference_Number(+) AND UNIT_USERS
    .Novell_User_Name = PERSON.Novell_User_Name (+) ORDER BY Make,
    Model, Asset_Number,Serial_Number,
    UNIT.Hardware_Reference_Number,Unit_Type,PERSON.Last_Name,PERSON.Fi
    rst_Name,PERSON.Novell_User_Name;
    3 /
    WHERE UNIT.Hardware_Reference_Number =
    UNIT_USERS.Hardware_Reference_Number(+) AND UNIT_USERS.Novel
    ERROR at line 2:
    ORA-00904: invalid column name
    REM -- Using the one with an return prior to the AND
    SQL> SELECT UNIT.Asset_Number,Model,PERSON.Novell_User_Name FROM
    UNIT, UNIT_USERS, PERSON
    2 WHERE UNIT.Hardware_Reference_Number =
    UNIT_USERS.Hardware_Reference_Number(+)
    3 AND UNIT_USERS.Novell_User_Name = PERSON.Novell_User_Name
    (+) ORDER BY Make, Model,
    4 Asset_Number,Serial_Number,
    5
    UNIT.Hardware_Reference_Number,Unit_Type,PERSON.Last_Name,PERSON.Fi
    rst_Name,PERSON.Novell_User_
    Name;
    ASSET_NUMBER
    MODEL
    NOVELL_USE
    10023445
    desktop raider
    tabisho
    10023445
    desktop raider
    pjblee
    100349864
    VEi8
    SQL>

    Ok. I feel ashamed that the answer was so simple and not the
    problem I thought it was. But in the interests of perhaps
    preventing someone else doing the same silly thing....
    The error was caused by using a wrong name when 'getting' the
    values int the return ResultSet object. (eg using getString
    ("s.Some_Name") when it should have been getString
    ("s.Another_Name").
    Interestingly the error did occur in one of our SQL*Plus
    versions. Why we still are not sure, but since this was a silly
    error on my part, I'm sure a similarly silly reason will be the
    cause there two.
    I appreciate those who responded though. It is a great resource.
    Darren James
    I'm just guessing here, but could it be some sort of a size thing? Could it be that, if you don't break up line 2, somehow
    it gets truncated or wrapped at an inappropriate place? To test
    this theory, you might try putting the carriage return in front
    of the ORDER BY, instead of in front of the AND, and see if it
    has the same effect. If you do get it figured out, please
    satisfy our curiosity and let us know.

  • Carriage Returns in XSLT output

    I need to output a text file with CRLF characters at the end of each line. I've explicitly put both characters into the XSLT file ( &lt;xsl:text&gt;&amp;#xD;&amp;#xA;&lt;/xsl:text&gt; ) but the default oracle.xml.parser.v2 in JDeveloper keeps converting the CR to LF. How can I force the parser to output the CR?

    This is incorrect. You can tell the processor to keep and output whitespace nodes if you use the character encodings (&amp;#xA; &amp;#xD; &amp;#x20; &amp;#x9;) and the output method is text. I am getting the correct output for space-only nodes (&amp;#x20;) and the linefeed character (&amp;#xA;). I am also getting a whitespace-only character for the carriage return (&amp;#xD;) node, it is just the <em>wrong</em> character - the parser is converting it to &amp;#xA;, so I am getting two linefeed characters where my stylesheet specifies &amp;#xD;&amp;#xA;.

  • Carriage Returns & Line Feeds in XML documents

    Does anyone know why the PL/SQL XML parser will NOT work with Carriage Returns (0x0D) within the XML document?
    Currently I'm having to strip them out, leaving just the Line Feed (0x0A).
    I only realised this after looking at the family.xml example document.
    T.I.A.
    Geoff

    I forgot to mention that I'm running Oracle 8i on Windows NT.

  • Carriage Return in External table column

    Im using Oracle 9.2.0.6 . On Aix.
    Ive created and external table pointing to a csv file.
    When I do a select on the last column of the external_table, it contains a carriage return / linefeed. If I try to make the colums specification smaller then it throws and error
    ORA-01401: inserted value too large for column
    How can I eliminate this unwanted character.
    line from csv file
    2,,,,,,,,,,,,,,BB
    table spec
    create table x_needsprop
    external_prop_ref varchar2(20),
    floor_level     varchar2(20),
    dcc     varchar2(4),
    lc     varchar2(4),
    ptd     varchar2(4),
    wc     varchar2(4),
    ec     varchar2(4),
    rspr     varchar2(4),
    err     varchar2(4),
    ctb     varchar2(4),
    bd     varchar2(4),
    nda     varchar2(4),
    ndd     varchar2(4),
    vsam     varchar2(4),
    res_type varchar2(5)
    ORGANIZATION EXTERNAL
    ( type oracle_loader
    default directory external_dir
    access parameters
    ( fields terminated by ',' )
    location ('needsprop.csv')
    /

    According to the documentation, adding the trim specifer 'RTRIM' directs that "spaces should be trimmed from the end of a text field. Spaces include blanks and other nonprinting characters such as tabs, line feeds, and carriage returns."
    create table x_needsprop
    external_prop_ref varchar2(20),
    floor_level varchar2(20),
    dcc varchar2(4),
    lc varchar2(4),
    ptd varchar2(4),
    wc varchar2(4),
    ec varchar2(4),
    rspr varchar2(4),
    err varchar2(4),
    ctb varchar2(4),
    bd varchar2(4),
    nda varchar2(4),
    ndd varchar2(4),
    vsam varchar2(4),
    res_type varchar2(5)
    ORGANIZATION EXTERNAL
    ( type oracle_loader
    default directory external_dir
    access parameters
    ( fields terminated by ',' RTRIM)
    location ('needsprop.csv')
    )

Maybe you are looking for