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')
)

Similar Messages

  • Default Carriage return in the last column when data is downloaded to Excel

    Problem:
    When you download data into Excel and if the last column of your excel is a numeric field, XMLP will add a carriage return (special character) to your numeric field. This feild will be considered as character field by excel.
    Work Around:
    When you build the template, create an empty column as your last column and leave E (or end-for-each) in that empty column.
    Note:
    If the last column is a character column then you do not have to do this.

    I originally had that END:VCARD without any carriage return.
    But I still get an extra carriage return at the end when the JSP renders to VCF
    I'm using Tomcat running on Linux.
    I found this, article which implies (but does not explicitly say) JSP in general adds a newline to the last line:
    http://www.caucho.com/resin-3.0/jsp/faq.xtp (But its not tomcat either, so maybe this info is irrelevant).
    Edited by: shogo2040 on Dec 22, 2008 3:31 PM - changed rendered to VCF from rendered to JSP

  • Carriage returns on  external tbl

    version 11g
    Just looking for some help. Built an external table from a csv file. One of the columns in the csv has fields that have data like so :
    From Submitter:
    Testing the tools was working well. Please see below comments.
    Tom Stevens (JRP Design)
    From Jim:
    Thanks and I will follow-up. Please send me contact info  and I will give him a call as well.
    So I create the table but when i try and select * from the tbl i get this error
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-30653: reject limit reached
    29913. 00000 -  "error in executing %s callout"
    *Cause:    The execution of the specified callout caused an error.
    *Action:   Examine the error messages take appropriate action.
    I check the error log and get this :
    KUP-04021: field formatting error for field USER_INPUT
    KUP-04036: second enclosing delimiter not found
    What can I put in the access parameters of the create table that can fix this ?
    Right now I am using
      ORGANIZATION EXTERNAL
        TYPE ORACLE_LOADER DEFAULT DIRECTORY "UTIL_FILES" ACCESS PARAMETERS
        records delimited BY newline
        skip 1 fields terminated BY ','
        OPTIONALLY ENCLOSED BY '"' ltrim
        MISSING FIELD VALUES ARE NULL
        LOCATION ( 'test.csv' ))

    What can I put in the access parameters of the create table that can fix this ?
    Nothing - as others already mentioned your data has embedded record delimiters in it. So the parser treats any 'newline' as the end of a record.
    Many tools cannot properly parse files with embedded record delimiters. Excel can but only if the entire field is enclosed in double quote characters.
    If that data field is NOT enclosed in double quotes you could try modifying the data to enclose it in double quotes.
    But the likely solution will probably involve either removing the embedded newlines or replacing them with some other character (e.g. space).
    You could also use a different delimiter such as the pipe '|' character.

  • Handling external table columns

    1) I am creating an external table which reads a file with 5 columns. All the columns are delimited by a '|' symbol. And one of the column is a combined column of 'state' and 'pincode'.
    I want to split them in the external table structure itself without creating a view from it. Is it possible to declare a external table structure like this.
    2) Also, in the same table a column comes with leading zeros. I want to use the 'TRIM' function instead of declaring the datatype as 'NUMBER'.
    Can anyone help me how to do these things.
    Thanks & Regards,
    Bh.

    Hi,
    Please use the New name for the External Table and create the view with the same name of the old external Table.
    In that case you need not to change in the package level.
    Regards
    K.Rajkumar

  • Returning ref of table.column object.. its possible?

    hello friends. see example bellow:
    create type object1 is object (id number);
    create table table1 (o object1, -- the collumn is object, but table not
    field2 varchar2(10);
    declare
    ref_object ref object1;
    begin
    -- how to do hold this ref var?????
    select ref(p.o) into ref_object
    from table1;
    -- raise exception.
    end;
    Help me please.

    What exactly are you trying to accomplish? To me, it looks like you are trying to select data into a user defined variable from a table. What do you mean exactly when you say you want to capture a reference (ROWID, ROWNUM, REF Cursor, etc.)?
    SQL>  DECLARE
      2   TYPE obj1 IS TABLE OF table_tipo_teste%ROWTYPE;
      3   obj2 obj1;
      4  BEGIN
      5          SELECT  tp
      6                 ,nome
      7    BULK COLLECT
      8            INTO obj2
      9            FROM table_tipo_teste;
    10    FOR i IN obj2.FIRST..obj2.LAST LOOP
    11      DBMS_OUTPUT.PUT_LINE( 'Data Held In Object: ' ||obj2(i).tp.id || ' ' || obj2(i).tp.nome || ' ' || obj2(i).nome
    12    END LOOP;
    13* END;
    SQL> /
    Data Held In Object: 1 Luiz Gustavo
    PL/SQL procedure successfully completed.
    SQL>

  • Remove carriage return between text two objects

    How to remove carriage return between objects. 
    I have a text box and table  I want to remove carriage return between them. 
    Also I have a table with two columns and I want to remove carriage return between these two columns.
    Thank You in advance.

    Hi ,
    Try like this ,
    --To replace Carriage return
    =REPLACE(Fields!Column.Value, CHAR(10), "" )
    --To replace Line feed
    =REPLACE(Fields!Column.Value, CHAR(13), "" )
    --To replace Tab
    =REPLACE(Fields!Column.Value, CHAR(9), "" )
    And also , ConsumeContainerWhitespace property to remove blank space -
    http://beyondrelational.com/modules/2/blogs/115/posts/11153/consumecontainerwhitespace-property-to-remove-blank-space-in-ssrs-2008-report.aspx
    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

  • SQLLDR is inserting carriage returns.

    Hello. I tried searching but didn't find anything specific to my problem. I have a lot of Access tables to load into Oracle. All of the Access tables get appended into the same Oracle table. I'm exporting the Access tables to a excel spreadsheet then saving as a csv file. I run SQLLDR and it's giving me an error on a column saying invalid number. I switch the number field over to a Varchar2 and it loads. When I view the data in enterprise manager it has a square next to the last number. I did a simple replace on the character using replace(flow_rate,chr(13),'') and inserting that data into a number field again.
    I'd like to be able to skip this step in the future. Is there a way to skip the carriage returns when loading.
    Thanks

    Thanks for the reply. Yes I am. I have a bunch of Access files on a NT server. I open them and export the table to a xls file on my desktop. I open the file then save it as a CSV on the desktop. I then use WinSCP3 to move the file from the desktop to the UNIX box which is where the Oracle database is located on.
    It only puts the carriage return in the last column data is in. I have workaround using the replace function but I'd like to just fix the problem.

  • UPPER function in external table definition ... ?

    Greetings
    Is there a way to specify a SQL function, like UPPER, in an external table column definition?
    I know I can do it with SQL*Loader in the control file but I haven't found a way to do it in OWB?
    I realize there are ways outside of the external table using a view, etc. but I'd like to reference the external table directly without having to create yet another object.
    Thanks very much!!
    -gary

    Greetings
    Is there a way to specify a SQL function, like UPPER, in an external table column definition?
    I know I can do it with SQL*Loader in the control file but I haven't found a way to do it in OWB?
    I realize there are ways outside of the external table using a view, etc. but I'd like to reference the external table directly without having to create yet another object.
    Thanks very much!!
    -gary

  • Importing XML Text files with Indesign friendly 'Carriage Returns'

    Hi,
    I have a question wrt importing XML into Indesign.  I have my text stored in Excel (Fig A) and intend to export as an XML file where each line will represent each page.  However, my first attempt failed to treat the 'carriage returns' as I'd envisaged:
    The 'carriage returns' used within an Excel cell (ALT-ENTER) are maintained when transforming to a CSV file (Fig B).  However, when converting to an XML file, the conversion only takes place on a line by line basis and hence the XML file becomes incomplete (Fig C).
    So, it appears I need to make sure that the CSV file contains one line per entry, while also maintaining the actual carriage returns in my source spreadsheet and for Indesign to recognise them.  In order to do this, I'll need to substitute the 'carriage returns' in my excel column to be represented by a new set of characters.  My question is how can I let Indesign know to recognise this set of characters to be converted to a carriage return, when importing text.
    For example, if this set of characters was '%%%%%%', then my new csv file would look like Figure D and the XML would be produced correctly, like Figure E.  Then importing this XML file to InDesign, the carriage returns would automatically be reinstated, hopefully.
    I hope someone can help me as I am only starting out in Indesign and feel Im running before I can walk by venturing into the XML/Indesign arena too soon.
    Best Regards
    Luke

    Hi,
    Thanks for all the responses.
    With regard to XML, it could well be an issue has crept in because I am using another utility to convert my csv's to xml and maybe there are better options out there. I will take a look for other utilities and try that (Its not possible from Excel easily, even though there is an option to save as an XML file).
    Secondly, because the XML was readable by internet explorer, I assumed it had a satisfactory standard XML format which would be accepted by any program, including InDesign.  This proved true, since the XML file i generated was actually recognised by my Indesign document and populated the tags correctly, albeit without any carriage returns. 
    When I save my excel sheet as a csv, it does actually hold the carriage returns causing multiple lines per entry, hence why I need to substitute the actual carriage returns in my excel sheet to a alternative character set so that the entry remains on one line.
    Re: Double quotes on text fields.  Im sorry, I didnt realise I had commas in my sample csv example.
    I should have corrected it, but I intend on using semi-colons as my csv delimiter and don't intend on having semi-colons in my excel sheet itself, so I possibly won't need any double-quotes.
    So, it looks like this is what I need to do ;
    i)   Add a column in Excel which substitutes all the carriage returns with a line break identifier (^n).
    ii)  Convert Excel file to a semi-colon csv holding this new column,
    iii) Convert csv file to XML using a good CSV->XML utility,
    iv)  Add the respective XML tags to my INDD document,
    v)   Add a GREP rule which does a find/replace on all instances of ^n and replace with a line break,
    vi)  Import the XML file,
    vii) Apply the find/replace GREP rule on the whole document. Carriage returns on my text fields should be consistent with my original excel sheet.
    Thanks for all your help fellas.  Will report on how I get on once Im done.
    Best Regards
    L

  • A special character in the last column in my external table

    Hello,
    I'v made a external table that looks like this :
    CREATE
    TABLE "REC_XLS"
    "FINANCE_DATE" VARCHAR2(50 BYTE),
    "CREATION_DATE" VARCHAR2(50 BYTE),
    "SENT_DATE" VARCHAR2(50 BYTE),
    "REMARKS" VARCHAR2(200 BYTE),
    "REMAINING_QUANTITY" VARCHAR2(30 BYTE),
    "CODE" VARCHAR2(30 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "LOADER" ACCESS PARAMETERS (
    RECORDS DELIMITED BY newline LOAD WHEN CODE!=BLANKS Skip 1 FIELDS
    TERMINATED BY 0X'09' MISSING FIELD VALUES ARE NULL REJECT ROWS
    WITH
    ALL NULL FIELDS ( Finance_date,
    creation_date, sent_date, Remarks,
    remaining_quantity, code) location ( 'Finance.tsv' )
    I exported the result in xls file and I saw in the last column a special character. The result of a copy and paste is prenseted here : "ABE
    You should notice that the last quote is in the upper line instead of at the end of ABE. This means, I think, that there is a carriage return at the end. And the 0X'09' is the tab separator. How can I get rid of this character ?

    my guess is that you run the load on unix server which uses default LF end-of-line character and the file has dos CRLF end-of-line, the easiest option is to change records delimiter in the DDL and replace "RECORDS DELIMITED BY newline" with code below
    RECORDS DELIMITED BY '\r\n'in general end-of-line can be really any character, sample above shows CRLF but it can be TAB, space, | or any other character or set of characters. I have samples of special characters on my blog http://jiri.wordpress.com/2009/01/29/oracle-external-tables-by-examples-part-1/
    hope this helps
    jiri

  • 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.

  • How to remove carraige return from the field while loading external table

    I am facing an issue of not getting rid of carraige returns present in the fileds of the source .csv file while loading the records into external table.
    I had tried using LRTRIM, but it does not help.
    The error I am getting is:
    KUP-04021: field formatting error for field POPULATION_DESCRIPTION
    KUP-04037: terminator not found
    I am pasting one record out of the .csv file which is causing this error as below:
    "Business Card Accounts
    ",123,7 BizCard - Gamers,Control,"Business Card Accounts
    ",75270,75271
    You can see the carraige return in the 1st field as well as 5th field. Filed are separated by commas & eclosed by double quotes.
    Could anybody help on this please?

    Can you copy the file to an external table only version, and then dos2unix it?
    Alternatively, you can use the ACCESS PARAMETERS area in your external table definition to set that your RECORDS DELIMITED BY carriage returns, instead of the default.
    Check out the example here http://www.psoug.org/reference/externaltab.html

  • How do I add either a line Feed or Carriage Return to a column?

    I am using
    "Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production"
    "PL/SQL Release 11.2.0.1.0 - Production"
    "CORE 11.2.0.1.0 Production"
    "TNS for Linux: Version 11.2.0.1.0 - Production"
    "NLSRTL Version 11.2.0.1.0 - Production"
    I would like to know when merging two results like so:
    select
         'Answer: ' || answer_value || 'Date: ' || date || 'Name' || name_value as notes
    from table
    to show as in the column:
    Answer: B
    Date: 07-11-2013
    Name: Johnny
    I get something like this
    Answer: B Date: 07-11-2013 Name: Johnny
    Is there a way to use Line Feed or Carriage Return?
    I tried using the char(10) but did not work.
    Also where are the instruction to be able to place the query into a format to allow others to see? Originally I learned to use code { } on this site, but they changed it.
    example:
    select
    'Answer: ' || answer_value || 'Date: ' || date || 'Name' || name_value as notes
    Testing it above.
    Plus what happened to the preview button to see if I posted it correctly?
    The section on" how to ask a question "did not have much about this.

    You may be going about this the wrong way.  Such formatting is normally left to the reporting tool.
    Embedding formatting junk (like cr/lf) in your data is not a good idea.  Not only does it not belong there, but it might not always work.  CR and/or LF are platform specific.

  • Problem with "carriage Return" or "Line Feed" in a table

    Hello,
    I need help with the function Zeichen(), so called it in german, I'm not sure if it is char() in english.
    In Pages Version 4.0.1 (746) I've created a table in Pages with this function to make an "carriage Return" in a cell.
    Here an example: { ="Hello" & Zeichen(10) & "World" }, in the cell is now:
    | Hello |
    | World |
    But in Pages Version 4.0.3 (766) this function ZEICHEN() not allow the number 10 and other till 32 (I allready read the manual and understand this problem).
    Anybody an idea to make a "Carriage Return" or "Line feed" in a formular, in a cell, in a table, in Pages?
    Thanks
    Detlev Kormann

    kdetlev wrote:
    Your workaround will not be possible in my table, because there is no empty cell in the table, but I think it is also a good help too.
    *In fact I forgot that you are using a table in Pages.*
    Remaining on my first idea, In Numbers we may achieve the same goal using an auxiliary table with a single cell containing the needed line break.
    If this table is named "LineBreak",
    the formula will be:
    ="Hello"&LineBreak :: $A$1&"World"
    *In Pages, here is my workaround:*
    Enter the cell
    type a§b
    don't type the character § but ctrl + return.
    The cell will contain
    a
    b
    with the arrow, move before the a
    type =B2&"
    delete the original a
    move to the right
    delete the original b
    type "&C7
    Yvan KOENIG (VALLAURIS, France) mercredi 7 octobre 2009 17:20:04

  • Report query not returning the field value from external table

    hi
    I have an issue regarding reports. I have a query having 4 fields from external table and remaining from db tables. the report query returns all the fields from the db tables and only 2 fields from external table. but the same query if I tried in plsql developer it returns all the fields values.
    Can anyone please help me in this issue.
    Thanks and Regards
    kk

    Duplicate post?
    value not displaying in report whereas it returns in plsql developer
    value not displaying in report whereas it returns in plsql developer
    Please log a SR if you do not get any reply to your thread instead of creating new one.
    Thanks,
    Hussein

Maybe you are looking for

  • How do I change the theme in Presenter to publish a page flip effect?

    I would like to change the theme in Presenter to save as and look like: http://page-flip.com/ How do I change the theme in Presenter to publish a page flip .swf & .pdf effect? Thank you for reply with help!

  • Audit log output!!!!

    Hi, I have enabled object Auditing on our production Database. Audit log destination i have given in OS level.(AUDIT_FILE_DEST='XXX') In Audit log it is showing statement id only. How can i know statement???? Below is the output of my database Audit

  • Set up bank email - automatic payment F110

    When we process the automatic payment  Tcode F110, SAP system will send file of all vendors/customers to the bank. How can we set up the bank's email and our email (which will appear as sender)? The system will send individually to each bank, or send

  • Saving monitor views as quicktime file

    For training purposes I would like to capture a series of actions from my screen and save as a quicktime file. I see Grab lets me take a single screen shot but I need to capture more than this. How can I do this? Thanks in advance

  • Configuring problem in tomcat

    i am trying to implement hibernate through tomcat. but cant able to do it...I am using hibernate3.0.3 and tomcat 4.1...can anyone suggest a solution. thanks Tapan