SQL Loader with decimal comma

Dear all,

I am loading data for a German client and the files shipped contain numeric data with decimal comma. For example 123.5 instead of 123.5

I've been Googling like crazy on this one and there is a lot of chatter on the definition of NLS_LANG and/or NLS_NUMERIC_CHARACTERS, but none of this seems to work in the environment SQL Loader.

I guess I'll end up tinkering together something complicated with TO_NUMBER or another function, but I really can't believe SQL Loader isn't a simple switch to return semicolon.

Or I forgot something?

Advice would be a great help.

Kind regards
Alan Searle

You can use something like:

Load data
INFILE...
BadFile...
....
fields completed by...
(
...
col1 "translate (: col1, ','.')", ".
...
)

Published by: SKU on January 28, 2009 04:41

Tags: Database

Similar Questions

  • SQL Loader with BCP datetime format

    Hi, Im having trouble loading of data from sybase to oracle may. I already .dat for my lens. However, its datetime column has changed its formula and it is not accepted to oracle.

    Please see below.

    Source table

    PUP_DATE

    ------------------

    2014-10-01 10:34:07.613

    PUP_DATE = datetime (sybase - source table)

    target table for pup_date data type is TIMESTAMP

    When my sybase database are imported via bcp on looked this way date format .dat file

    .dat file

    ....

    < EOFD > 1000017962 < EOFD > Oct1 2014 AM < EOFD > 10:34:07.613

    ...

    bcp sql developer-generated command line

    BCP dbname.dbo.table_name /directory/test.dat - c t '< EOFD >' - r '< EORD >' - Usa - Ppassword - Sservername

    What can I do to keep its format which is accepted at oracle?

    I tried to change the date and time stamp of mask in sqldeveloper migration options. also the mapping of datatime timestamp data type.

    Thank you!

    The following shows how to use TO_TIMESTAMP in your SQL * control file loader to load your test.dat file data in a column of timestamp into a target of Oracle table.

    Scott@orcl12c > test.dat TYPE of HOST

    1000017962Oct1 2014 10:34:07.613 AM

    Scott@orcl12c > test.ctl TYPE of HOST

    DOWNLOAD THE DATA

    Test.dat INFILE

    IN the purpose of the TABLE

    FIELDS TERMINATED BY ''.

    TRAILING NULLCOLS

    (fill1 FILLER

    fill2 FILLER

    ', pup_date ' TO_TIMESTAMP (: pup_date, ' MonDD YYYY hh.) (FF3AM') ')

    Scott@orcl12c > CREATE TABLE target

    2 (pup_date TIMESTAMP)

    3.

    Table created.

    Scott@orcl12c > HOST SQLLDR scott/tiger CONTROL = test.ctl LOG = test.log

    SQL * Loader: release 12.1.0.1.0 - Production on Wed Jan 7 12:05:18 2015

    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

    Path used: classics

    Commit the point reached - the number of logical records 1

    TARGET table:

    1 row loaded successfully.

    Check the log file:

    test.log

    For more information on the charge.

    Scott@orcl12c > SELECT * TARGET

    2.

    PUP_DATE

    ---------------------------------------------------------------------------

    1ST OCTOBER 14 10.34.07.613000 AM

    1 selected line.

  • SQL Loader with the line terminator

    Dear friends,

    I use Oracle 10 g R2.

    Need to load some records to a text file to Oracle.

    It's my control file:
    LOAD DATA 
    INFILE 'D:\load\dat\FinNote.dat' 
    BADFILE 'D:\load\bad\FinNote.bad' 
    DISCARDFILE 'D:\load\dat\discard\FinNote.dsc' 
    INSERT INTO TABLE FinNote FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' TRAILING 
    NULLCOLS
    ( IDNo, RegDate date 'YYYY-MM-DD HH24:MI:SS', Col1, Remark, UserID, Status)
    {code}
    
    My text file has semicolon as a row delimiter and | as column delimiter. Now, how can I add the semicolon as row delimiter. Please guide me.
    
    I followed the method given in this site: 
    http://www.exforsys.com/tutorials/oracle-10g/oracle-10g-sql-loader-input-data-and-datafiles.html
    
    
    *INFILE datafile_name ["str terminator_string"]*
    
    {code}
    LOAD DATA 
    INFILE 'D:\load\dat\CRS_FinNote.dat' ";"
    BADFILE 'D:\load\bad\CRS_FinNote.bad' 
    DISCARDFILE 'D:\load\dat\discard\CRS_FinNote.dsc' 
    INSERT INTO TABLE CRS_FinNote FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' TRAILING 
    
    NULLCOLS
    ( StudentNo, IDate date 'YYYY-MM-DD HH24:MI:SS', Topic, Remark, UserID, Status)
    and received the error:

    SQL * Loader-500: could not open the file (D:\load\dat\CRS_FinNote.dat)
    SQL * Loader-555: unrecognized property treatment option
    SQL * Loader-509: System error: the operation completed successfully.
    SQL * Loader-2026: the charge was dropped because SQL Loader cannot continue.
    SQL * Loader-513: cannot close the file (D:\load\dat\CRS_FinNote.dat)
    SQL * Loader-559: Error closing file
    SQL * Loader-509: System error: the storage control block address is invalid.

    Thanks in advance.
    Nith

    Published by: user645399 on June 16, 2010 10:35

    And, if your CRS_FinNote.dat look like below (line/record delimited; then)

    1245|2000-05-16|Oracle|The Best|AAA|Online;
    294|2000-04-03|Dotnet|Best|BBB|Pending;
    300|2010-03-28|C++|The Best|CCC|Offline;
    

    Scott@ORCL > select utl_raw.cast_to_raw (';') under "hexadecimal;" double;

    in hexadecimal
    --------------------------------------------------------------------------------
    3B

    Then I change user645399.ctl with below:

    LOAD DATA
    INFILE 'd:\csv\CRS_FinNote.dat' "str X'3B'"
    BADFILE 'd:\csv\FinNote.bad'
    DISCARDFILE 'd:\csv\FinNote.dsc'
    INSERT INTO TABLE FinNote FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' TRAILING
    NULLCOLS
    ( IDNo, RegDate date 'YYYY-MM-DD HH24:MI:SS', Col1, Remark, UserID, Status)
    

    The idea received a link from http://www.orafaq.com/forum/t/140062/0/.

    C:\Documents and Settings\Girish Sharma>sqlldr scott/tiger@orcl control=d:\csv\user645399.ctl log=user645399.log
    
    Enter user-name: scott/tiger
    
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    
    SCOTT@orcl> select * from finnote;
    
          IDNO REGDATE              COL1       REMARK     USERID     STATUS
    ---------- -------------------- ---------- ---------- ---------- ----------
          1245 16-may-2000 00:00:00 Oracle     The Best   AAA        Online
           294 03-apr-2000 00:00:00 Dotnet     Best       BBB        Pending
           300 28-mar-2010 00:00:00 C++        The Best   CCC        Offline
    
    SCOTT@orcl>
    

    HTH
    Girish Sharma

  • SQL Loader with null values

    Dear friends,

    I have comma-delimited .dat files. Here is the example.
    abc, xyz, 456
    ase, asd, 890
    I have no problem loading using sql loader under normal circumstances.

    When a null value somewhere, for example:
    abc, , 456
    ase, asd, 890
    or
    , xyz, 456
    ase, asd, 890
    I could not load them.

    How can I fix this error?

    Any suggestion?

    I am using Oracle 10 g R2 running on Windows Server 2003

    That's how I connect
    $sqlldr userid=userid/password control=d:\load\controlfile\table_name.ctl log=D:\load\log\tablename.log resumable = true errors=0
    It is a way the contorl file looks like
    LOAD DATA INFILE 'D:\load\dat\tablename.dat' BADFILE 'D:\load\bad\tablename.bad' DISCARDFILE 'D:\load\dat\discard\tablename.dsc' 
    INSERT INTO TABLE tablename FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS( col1, col2, col3)
    {code}
    
    How can I handle this?
    
    Please advice.
    
    Thanks in advance.
    
    Nith
    
    Edited by: user645399 on Jun 14, 2010 1:38 PM
    
    Edited by: user645399 on Jun 14, 2010 1:38 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    Try column_name '' in the control file.

  • SQL * loader with forms

    I use oracle 10 g on windows 7 32-bit forms.

    I want to load the shape data of oracle to the oracle database.
    I wrote the following code on buttons when pressed to release button.

    declare
    Usid varchar2 (10): = get_application_property (username);
    pwd varchar2 (10): = get_application_property (password);
    DB varchar2 (10): = get_application_property (connect_string);
    v_ctl_file text_io.file_type;
    v_live_path varchar2 (1000): =:-';
    v_bat_file text_io.file_type;

    Start

    v_ctl_file: = text_io. FOPEN(v_live_path||) e test. CTL', 'w');
    text_io. Put_line (v_ctl_file, "LOAD DATA");
    TEXT_IO. Put_line (v_ctl_file, ' INFILE "'| v_live_path |) (' Data.csv "');
    TEXT_IO. Put_line (v_ctl_file, 'INTO TABLE test');
    TEXT_IO. Put_line (v_ctl_file, ' done by ',' ' possibly surrounded by fields "'" ');
    TEXT_IO. Put_line (v_ctl_file, '(id, nom, salaire) ");
    TEXT_IO. FCLOSE (v_ctl_file);

    v_bat_file: = text_io. FOPEN(v_live_path||) load_data.bat e', 'w');
    TEXT_IO. Put_line (v_bat_file, 'sqlldr userid =' | usid |) '/' || pwd | '@' || DB |
    * 'MISTAKES is 1000000 control =' |. v_live_path | "log test. CTL = ' | v_live_path | (' test.log'); *
    text_io. FCLOSE (v_bat_file);

    Host(v_live_path||) e load_data.bat');

    Exception when others then
    message(SQLERRM|| dbms_error_text);
    message(' ');
    end;


    Content of my control file is THEREFORE

    DOWNLOAD THE DATA
    INFILE 'D:\data.csv '.
    IN THE test TABLE
    completed by ',' optionally surrounded by fields ' "'"
    * (ID, Name, salary). *

    Content of batch file:
    sqlldr userid = SCOTT/TIGER@orcl ERROR = 1000000 control log D:\test.ctl = D:\test.log =


    But on my command prompt, I get the following message

    Is not recognized as internal or external command, executable prgram or SQLLDR command file. _

    Thank you

    Edit your file of commands like the following and see if it works

    SET ORACLE_HOME=C:\oracle\ptoduct\10.2.0\db_1
    SET PATH=%ORACLE_HOME%\bin;%PATH%
    sqlldr userid = SCOTT/TIGER@orcl ERRORS=1000000 control = D:\test.ctl log = D:\test.log
    

    See you soon,.

  • Problem with SQL Loader ODI

    Hello

    I have problems using SQL Loader with ODI. I am filling an oracle table with data from a txt file. Initially, I had used 'File to SQL' LKM, but due to the size of the file (700 MB) source, I decided to use 'file to Oracle (SQLLDR)' LKM.
    The error that appears in myFile.txt.log is: "SQL * Loader-101: invalid argument for the name of user and password.

    I think the problem might be in the definition of the database server (physical JavaBeans in topology), because I left empty Host, user and password.

    What is the problem? What host and user should I use? With "File to SQL" works fine living that white, but takes too much time.

    Thanks in advance

    Note the last * @*. He expects a connection string after him.

    So, goto Oracle server topology, specify Instance/Dblink (server) as the SID of the oracle database you want to connect.

  • How do we improve the SQL Loader for EBS?

    Hi all

    We would like to use some of the new features like the FILLING and the EXPRESSION in the 10g version of SQL * Loader with the concurrent Manager.

    EBS 11i version SQL Loader is 8i.

    How do we improve the SQL Loader for EBS?

    Thanks in advance!

    If you are referring to executable files under ORACLE_HOME 8.0.6, then it cannot be migrated to 10 g / 11 g - upgrade developer 6i with Oracle Applications 11i [125767.1 ID]

    For executable files of database, please visit:

    Interoperability Notes Oracle EBS 11i with Oracle Database 11 g 2 (11.2.0).) [ID 881505.1]
    Oracle Applications Release 11i with Oracle 10 g Release 2 (10.2.0) [ID 362203.1]

    Thank you
    Hussein

  • SQL Loader Help in 10g

    Hello

    Is it possible to abort the sql loader with force when a value is not present? I have data like this file

    1. XXX123 | XXX | 20121121 |
    4. XXX123 | XXX |
    5. XXX123 | XXX | 1.
    5. XXX123 | XXX | 2.
    5. XXX123 | XXX |
    9. XXX123 | XXX |

    Model:
    record type | Batch number. lot desc | date | detail line num | other

    1,4,5,9 are the types of records, if you see this line 5. XXX123 | XXX | 1| .. 1 represents a number of detail line, my requirement is if the number of detail line is null for the record type 5 then I want to abort the sqlloader.

    Is this possible?

    Published by: 940838 on November 21, 2012 23:54

    940838 wrote:
    I think that I am not clear in my requirement...

    The question was how to abort the charger if the number of detail line is not present in the record type 5. It is, however, normal detailing line num is not required for other types of records. points of view.

    Hello

    you were clear, and I did a quick test. Unfortunately you can not do this check in SQL * Loader as the WHEN in the control file clause allows not just GOLD.

    Even if you add this check using a constraint in your table and specify the maximum number of errors to 0, SQL * Loader will load the files until this error.

    Let me show you an example:

    (1) create a table with a constraint that, for record_type detail_line_number 5, may not be null.

    CREATE TABLE test
    (
       record_type    INTEGER
     , batch_number   VARCHAR2 (10)
     , batch_desc     VARCHAR2 (10)
     , batch_date     DATE
     , detail_line_num INTEGER
     , other          VARCHAR2 (10)
    );
    
    ALTER TABLE test
      ADD CONSTRAINT check_rec_5
         CHECK (   record_type = 5 AND detail_line_num IS NOT NULL
                OR record_type != 5) ENABLE;
                
    

    In this table, you will not be able to load lines with a record_type = 5 and NULL detail_line_num as this will be considered an error.

    We will prepare your input file:

    1|XXX123|XXX|20121121||
    4|XXX123|XXX|||
    5|XXX123|XXX||1|
    5|XXX123|XXX|||
    5|XXX123|XXX|||
    9|XXX123|XXX|||
    1|XXX123|XXX|20121121||
    4|XXX123|XXX|||
    5|XXX123|XXX||1|
    5|XXX123|XXX||2|
    5|XXX123|XXX|||
    9|XXX123|XXX|||1|XXX123|XXX|20121121||
    4|XXX123|XXX|||
    5|XXX123|XXX||1|
    5|XXX123|XXX||2|
    5|XXX123|XXX|||
    9|XXX123|XXX|||1|XXX123|XXX|20121121||
    4|XXX123|XXX|||
    5|XXX123|XXX||1|
    5|XXX123|XXX||2|
    

    As you can see that the input file has the fourth line with record_type = 5 and detail_line_num NULL. It is a mistake of the constraint.

    Here I used the control file:

    --test.ctl
    load data
    INFILE 'test.dat'
    APPEND
    INTO TABLE test
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS
    (
     record_type     ,
     batch_number    ,
     batch_desc      ,
     batch_date      Date 'YYYYMMDD',
     detail_line_num ,
     other
    )
    

    If I try to run the SQL * Loader and ask to stop at the first error in this way:

    sqlldr userid=yourname/yourpass@yourdb control=test.ctl errors=0 rows=100
    

    SQL * Loader performs only 3 folders because it encounters an error in line 4 and having specified errors = 0 will not continue to load. In fact, the process will continue until she reached the point of validation (in this case 100 lines), but it is not loading any record after the error, or continue to read the file.

    So, if I check the table

    SELECT * FROM test;
    
    RECORD_TYPE BATCH_NUMBER BATCH_DESC BATCH_DATE            DETAIL_LINE_NUM OTHER
    ----------- ------------ ---------- --------------------- --------------- ----------
              1 XXX123       XXX        21-11-2012 00:00:00
              4 XXX123       XXX
              5 XXX123       XXX                                            1           
    

    You will only see the records until you have reached the error.

    This can be avoided, as documented in SQL * Loader manual reference:

    Load interrupted because they exceeded the maximum number of errors


    If the maximum number of errors is exceeded, SQL * Loader stops loading documents in any table and the work accomplished so far is committed.

    As you can see SQL * Loader to interrupt the treatment, but it engage in any case files until this error.

    Another solution is to create an external table in Oracle and do all the checks you want before you copy your table in a database table, as suggested BluShadow.

    Kind regards.
    Al

  • SQL Loader issue - CSV with commas and quotes IN the data

    Hello, I have a dataset for a simple table of 2 columns like this:

    Column 1, "it is given for"Column 2", with commas and quotes."

    Data are delimited by commas and may be surrounded by double quotes.  In ADDITION, it may include commas and quotation marks in the data fields.  I CANNOT manipulate data before sending it to SQL Loader.

    I set my file of control like this:

    DOWNLOAD THE DATA

    INFILE '. / TEST.dat'

    BADFILE '. / TEST. BAD'

    DISCARDFILE '. / TEST. DSC"

    REPLACE IN THE TEST TABLE

    Fields ended by ',' POSSIBLY BOX BY ' "' TRAILING NULLCOLS"

    (

    Col1 char (50),

    Col2 char (500)

    )


    Now when I run the present via SQLLDR, I get the following error in the log file:


    Sheet 1: Rejected - error on table TEST, column COL2.

    no terminator found after CLOSE and CLOSED field

    What are my options to get the loaded data as presented above?  I'm working on Oracle 11 g (11.2.0.3.0) 64-bit on AIX 6.1.0.0.

    Thank you!

    In this case, there is no way she can tell who's a delimiter or pregnant and which is part of the data.  As far as I know, there is no way that you can load it into the appropriate columns.

  • SQL Loader Control file - which represent decimal numbers

    Hello

    I use the version of database Oracle 10.2.0. I will receive a data file delimited pipe I need to load into the table specified below. Can you please suggest me how to represent the last column ERROR_PERCENT in the control file, which is number (3.2) in the table? I tried DECIMAL (3,2), EXTERNAL (3,2) DECIMAL against it and I get errors wasgetting. Help, please.



    CREATE TABLE TRACK_ERRORS
    (
    ACCOUNT_ID NUMBER (7).
    DATESTAMP TIMESTAMP (6).
    SPECIFIC_RISK NUMBER (3).
    STOCK_RISK NUMBER (3).
    ERROR_PERCENT NUMBER (3.2)
    )



    OPTIONS (SKIP = 1)
    DOWNLOAD THE DATA
    INFILE 'C:\Sqlldr\Input\Track_Errors.dat '.
    BADFILE "C:\Sqlldr\Track_Errors.bad."
    DISCARDFILE 'C:\Sqlldr\Track_Errors.dis '.
    ADD
    IN THE TABLE "TRACK_ERRORS.
    fields ended by ' |' SURROUNDED OF POSSIBLY "" "
    TRAILING NULLCOLS
    (Account_Id EXTERNAL INTEGER (7)
    , datestamp 'Rtrim (to_date (:datestamp,'YYYY/MM/DD')).
    Specific_Risk INTEGER EXTERNAL (3)
    Stock_Risk INTEGER EXTERNAL (3)
    ERROR_PERCENT
    )


    Kind regards
    Naveen

    Naveen Kumar C wrote:
    I tried with decimal external. It does not work. The following is the log file

    SQL * Loader: Release 10.2.0.1.0 - Production on Thu Feb 25 10:11:42 2010

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    Control file: track_errors.ctl
    Data file: C:\Sqlldr\Input\Track_Errors.dat
    Bad leadership: C:\Sqlldr\Track_Errors.bad
    Delete the file: C:\Sqlldr\Track_Errors.dis
    (Allow all releases)

    Number of loading: ALL
    Number of jump: 1
    Authorized errors: 50
    Link table: 64 lines, maximum of 256000 bytes
    Continuation of the debate: none is specified
    Path used: classics

    Table "TRACK_ERRORS', loaded from every logical record.
    Insert the option in effect for this table: APPEND
    TRAILING NULLCOLS option in effect

    Column Position Len term Encl. Datatype name
    ------------------------------ ---------- ----- ---- ---- ---------------------
    FIRST ARGUMENT ACCOUNT_ID 7 | O ("") CHARACTER
    DATESTAMP NEXT * | O ("") CHARACTER
    The SQL string for the column: "Rtrim (to_date (:datestamp,'YYYY/MM/DD')).
    SPECIFIC_RISK 3 | O ("") CHARACTER
    STOCK_RISK 3 | O ("") CHARACTER
    ERROR_PERCENT NEXT * | O ("") CHARACTER

    Sheet 1: Rejected - error on the table 'TRACK_ERRORS", the ERROR_PERCENT column.
    ORA-01438: value larger than the precision specified for the column

    Sheet 2: Rejected - error on the table 'TRACK_ERRORS", the ERROR_PERCENT column.
    ORA-01438: value larger than the precision specified for the column

    Sheet 3: Rejected - error on the table 'TRACK_ERRORS", the ERROR_PERCENT column.
    ORA-01438: value larger than the precision specified for the column

    Table "TRACK_ERRORS":
    0 rows successfully loaded.
    3 rows not loaded due to data errors.
    0 rows not loading because all WHEN clauses were failed.
    0 rows not populated because all fields are null.

    The space allocated to bind table: 34432 byte (64 lines)
    Bytes of read buffer: 256000

    Ignored logical records total: 1
    Total logical records read: 3
    Total rejected logical records: 3
    Total logical records ignored: 0

    Run started the Thu Feb 25 10:11:42 2010
    Run finished the game Feb 25 10:11:55 2010

    Time was: 00:00:13.99
    Time processor was: 00:00:00.14

    It does not work because of the data and not + external comma +.
    These mistakes ORA-set out clearly that your data values are larger than the eligible accuracy.

    isotope

  • SQL loader, problem with the POSITION &amp; EXTERNAL

    Hi gurus of the Oracle.

    I have problem with position and external.

    I have the data file with the data of 1 million records

    data delimiter is to and eventually closed by «»

    some lines are not loaded due to errors of data, i.e. data contains some «»

    now, we decided to use the position & external. am unable to write the control file.

    any help would be much appreciated

    The table name is person_memo, 4 columns

    ID_PERSONVARCHAR2 (9 bytes)
    TX_MEMOVARCHAR2 (1000 bytes)
    ID_USERVARCHAR2 (20 bytes)
    TM_STAMPTIMESTAMP (6)

    my control file is

    DOWNLOAD THE DATA

    ADD THE PERSON_MEMO TABLE

    FIELDS TERMINATED BY ' |'

    SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    (

    ID_PERSON POSITION (1) "CUT (: ID_PERSON).

    , TX_MEMO POSITION (10) TANK (1000) "CUT (: TX_MEMO).

    , POSITION (1012) ID_USER "TRIM (: ID_USER).

    , TM_STAMP POSITION (1031) EXTERNAL (26) ' DECODE (: TM_STAMP, NULL, NULL, TO_TIMESTAMP (: TM_STAMP, ' YYYY-MM-DD - HH24.MI.)). SS. "(FF')).

    )

    specimen of data file

    "04725813" | "aka"Little Will"" "|" " 095TDEAN «|» 2013-02-21 - 11.13.44.632000

    "05599076" | "" FIRST NAME - ADDED A 'T' AS ON THE REG MAP | ' 016DDEAL ' |. ' 2014-04-11 - 10.06.35.598000

    Thanks and greetings

    REDA

    In your control file, EXTERNAL (26) must be INTEGER EXTERNAL (26).

    Unfortunately, this forum destroyed the spacing, so I can't say whether or not your data are positionnelles.  If it is positional, you can then use positions, but you need start and end positions.  The positions that you posted have nothing to do with the data you've posted.  If you use positions, you can eliminate the delimiters and the beginning and the end of citations using these positions.

    If your data are not positionnelles and you have quotes in your data in quotes, but you don't have the pipe delimiters in your data, then you can only use the delimiters and trim the quotes start and final data.

    I have demonstrated the two methods below, using test1.ctl for the positional method and test2.ctl for the defined method.

    Scott@orcl12c > host type test.dat

    "04725813" | "aka"Little Will"" | "" 095TDEAN «|» 2013-02-21 - 11.13.44.632000

    "05599076" | "" FIRST NAME - ADDED A 'T' AS ON THE REG MAP | ' 016DDEAL ' |. ' 2014-04-11 - 10.06.35.598000

    Scott@orcl12c > type host test1.ctl

    DOWNLOAD THE DATA

    ADD THE PERSON_MEMO TABLE

    FIELDS TERMINATED BY ' |'

    TRAILING NULLCOLS

    (ID_PERSON POSITION (02:10))

    , TX_MEMO POSITION (14:59)

    POSITION ID_USER (63:82)

    , TM_STAMP POSITION (85:110) EXTERNAL INTEGER (26) ' DECODE (: TM_STAMP, NULL, NULL,).

    TO_TIMESTAMP (: TM_STAMP, ' YYYY-MM-DD - HH24.MI.) SS. "(FF')).

    )

    Scott@orcl12c > type host test2.ctl

    DOWNLOAD THE DATA

    ADD THE PERSON_MEMO TABLE

    FIELDS TERMINATED BY ' |'

    TRAILING NULLCOLS

    (ID_PERSON "TRIM ("------"" FROM: ID_PERSON ")")

    , TX_MEMO CHAR (1000) "TRIM ("------"" FROM: TX_MEMO ").

    , ID_USER "TRIM ("------"" FROM: ID_USER ").

    , TM_STAMP INTEGER EXTERNAL (26) ' DECODE (: TM_STAMP, NULL, NULL,).

    TO_TIMESTAMP (: TM_STAMP, ' YYYY-MM-DD - HH24.MI.) SS. "(FF')).

    )

    Scott@orcl12c > create table person_memo

    2 (ID_PERSON VARCHAR2 (9 bytes)

    3, TX_MEMO VARCHAR2 (1000 bytes)

    4, ID_USER VARCHAR2 (20 bytes)

    5, TM_STAMP TIMESTAMP (6))

    6.

    Table created.

    Scott@orcl12c > host sqlldr scott/tiger control = test1.ctl data = test.dat log = test1.log

    SQL * Loader: release 12.1.0.1.0 - Production Thursday, May 15, 10:53:11-2014

    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

    Path used: classics

    Commit the point reached - the number of logical records 2

    Table PERSON_MEMO:

    2 rows loaded successfully.

    Check the log file:

    test1.log

    For more information on the charge.

    Scott@orcl12c > select * from person_memo

    2.

    ID_PERSON

    ---------

    TX_MEMO

    --------------------------------------------------------------------------------

    ID_USER

    --------------------

    TM_STAMP

    ---------------------------------------------------------------------------

    04725813

    aka "Little Will"

    095TDEAN

    21 FEBRUARY 13 11.13.44.632000 AM

    05599076

    FIRST NAME - ADDED A 'T' AS ON THE REG MAP

    016DDEAL

    11 APRIL 14 10.06.35.598000 AM

    2 selected lines.

    Scott@orcl12c > truncate table person_memo

    2.

    Table truncated.

    Scott@orcl12c > host sqlldr scott/tiger control = test2.ctl data = test.dat log = test2.log

    SQL * Loader: release 12.1.0.1.0 - Production Thursday, May 15, 10:53:11-2014

    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

    Path used: classics

    Commit the point reached - the number of logical records 2

    Table PERSON_MEMO:

    2 rows loaded successfully.

    Check the log file:

    test2.log

    For more information on the charge.

    Scott@orcl12c > select * from person_memo

    2.

    ID_PERSON

    ---------

    TX_MEMO

    --------------------------------------------------------------------------------

    ID_USER

    --------------------

    TM_STAMP

    ---------------------------------------------------------------------------

    04725813

    aka "Little Will"

    095TDEAN

    21 FEBRUARY 13 11.13.44.632000 AM

    05599076

    FIRST NAME - ADDED A 'T' AS ON THE REG MAP

    016DDEAL

    11 APRIL 14 10.06.35.598000 AM

    2 selected lines.

  • Encapsulate data problems when loading with sql loader

    Hi all

    I use sql loader to load data into a flat file HP UNIX.

    I find the fi the NUMBER data type or date type get wraped to the new line, the control file triggered errors.

    The data looks like to (field dilimiter is |, record dilimter is ~):

    1 A87CCH | 1 A87CCH | PLAN_ACCOUNT_PROMOTION | HIR6A-1 | 20100706 06:06:24 | 1 DNE1 | DC?
    2010.7 FY1011 Promoiton | 1 A87AW0 | 1 HJEZE | Private | 20100730 00:00:00 | 00 20100710
    : 00:00 | 0 | Completed | 20100730 00:00:00 | 20100710 00:00:00 | 0 | 1 4A6PKP | TFMAAI | N
    | 0 | 0 | 0 | 0 | 0 | 0 | 1 4A6PKP | Approved | 1 8U4E-163 | 00:00:20110630 00 |
    20100708 01:45:35 | 20100707 00:00:00 | -1||| 0 | 9000 | 0 | 0 ||| 100. N | 0 | 0 | 0 | 0
    | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | N | 20110426 04:01:34 | 1 8U4E-163 | 0|||||||||
    ||||| ~


    The control file looks like:

    OPTIONS (ERRORS = 1000, DIRECT = TRUE, PARALLEL = TRUE, DATE_CACHE = 5000, discardmax = 50)
    UNRECOVERABLE
    load data
    INFILE ' / home/bs7822/leon/leon.dat' "str" ~ "»
    BADFILE ' / home/bs7822/leon/leon.bad'
    DISCARDFILE ' / home/bs7822/leon/leon.discard'
    ADD THE LEON_123456 TABLE
    FIELDS TERMINATED BY ' | '. SURROUNDED OF POSSIBLY "" "
    TRAILING NULLCOLS
    (
    X_INTERFACED_DT EXPRESSION "to_date (replace (replace (: X_INTERFACED_DT_BF, chr (10),"), Chr (13), "), 'YYYYMMDD hh24:mi:ss')", "
    X_INTERFACED_DT_BF boundfiller,
    EXTERNAL DECIMAL X_ACCRUAL_AMT,
    X_PLAN_SHIPMENT_PATTERN_ID TANK (90)
    )

    I think that replace it can treat the wrapped date. But I want to know if we can find a faster or easier way to conquer this topic since the beginning.

    Best regards

    Leon

    user12064076 wrote:
    Thank you for your response. But how to ensure that a record is in a single line? For example, to unload data with coil?

    The table has more than 100 columns.

    Best regards
    Leon

    UH... which guarantee is implemented by anyone or anything that generates the data in the first place.
    for example if I am extracting data to CSV for a customer or another application, making sure that it is 1 card per line with delimiters known etc.

    What is your own code that produces the data in the first place? If so, how are you to produce? With large amounts of data I wouldn't do it with SQL * Plus spool command, but I do with UTL_FILE within PL/SQL, or generating data in a file CLOB and spell the CLOB in a go using one of the CLOB methods available writing files.

  • cfqueryparam, numeric with decimal problem comma!

    Hello everyone,

    After the lobby day and night without finding a solution, I turn on the forum for help. As a value for a cfquery Insert, I use this among others: < cfqueryparam value = "" #p.PAskPrice # "cfsqltype ="cf_sql_numeric"/ >,."

    (P.PAskPrice) values from an xml file that has stored numbers with separators decimal comma (you see, that's the Greece - European language) and I get the error invalid data for CFSQLTYPE CF_SQL_NUMERIC 0.00. How can I inform the validator cf_sql_numeric separator is valid? Any help would be appreciated.

    Thanks in advance,

    Yannis

    You can't, there is sql. use lsParseNumber on the value to insert:

    Although I guess be thorough, try to set the locale (setLocale ("el_GR")) to

    This page. pretty sure it wont but might as well test.

    also for my own curiosity, which is the locale of the server?

  • How to use SQL * Loader to load the XMLType column with other columns?

    Hello

    I try to use sqlldr to load an XML file into a table with an XMLType column. I have found many examples where the entire table is an xmltype, but I'd like to load a lot of XML objects in a generic table for treatment with a single XMLType column and other columns to identify the load. A simple example, I have a constant column which I want to put during the download.

    The following example does not work: (.) No error either.

    create the table xml_upload
    (the varchar2 (10) of upload_type not null,)
    donnees_xml XMLType)
    /

    my control file:
    DOWNLOAD THE DATA
    INFILE * add
    IN THE TABLE xml_upload
    XMLType (xml_data)
    FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
    (
    constant upload_type MARKET,
    donnees_xml
    )
    BEGINDATA
    < SALE_ORDER >
    TIM < CUST_CODE > < / CUST_CODE >
    < ORDER_NUM > 1234 > < / ORDER_NUM >
    < / SALE_ORDER >


    $ sqlldr my.ctl

    SQL * Loader: Release 10.2.0.4.0 - Production on Sun Sep 27 22:51:52 2009

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Commit the point reached - the number of logical records 4

    SQL > select * from xml_upload;
    no selected line
    SQL >

    Any ideas on how I can do this? Did I miss something...

    I also played with the clause sqlldr lobfile, also without success.

    Current database version is 10g R2.

    Thank you
    Tim.

    The following works in 11.1.0.6

    LOAD DATA
    INFILE *
    INTO TABLE xml_upload TRUNCATE
    (
     upload_type constant 'MARKET'
    ,file_name filler char(100)
    ,xml_data LOBFILE (file_name) TERMINATED BY EOF
    )
    BEGINDATA
    test.xml
    
    SQL> select upload_type,xmlserialize(document xml_data no indent) from xml_upload;
    
    UPLOAD_TYP XMLSERIALIZE(DOCUMENTXML_DATANOINDENT)
    ---------- ----------------------------------------------------------------------
    MARKET        1
    
    SQL> 
    
  • Import data... Wizard creates the file SQL Loader ctl with columns out of order

    4.1.1.19 SQL Developer version. Connected to Oracle XE to test this.

    I'm trying to understand what the problem with the data in my import file when finally, I realize that the Import Wizard of data did not care how I traced the columns at all. The ctl SQL Loader file generated by the Wizard expects that the columns of data in my file to match the order that they appear in the definition of the table and not how they have been mapped in the wizard. Manually edit the ctl file is a workaround. Has anyone else seen elsewhere?

    I see that this is a bug.

Maybe you are looking for