SQL Loader data loading problem

Hi all, Oracle version 11.0.2 I have a table with 6 columns with all the non-null fields, if my flat file does not contain a date and then during the insertion, I insert the sysdate. But here, I can't make my column as default sysdate while creating the table. Is my control file and data are the following: the error I get is on the PLAY_DATE column. LOAD DATA INFILE *-'c:\combo-fix.txt' INTO TABLE results APPEND FIELDS TERMINATED BY ',' TRAILING NULLCOLS (fixture_date DATE play_date, 'DDMMYYYY' DATE 'DDMMYYYY' 'NVL(:play_date,sysdate)', home_team, away_team, home_points 'NVL(:home_points,0)' away_points' NVL(:away_points,0) "") BEGINDATA 18082012,18082012, AUSTRALIA, NEW ZEALAND, 19, 27 18082012,18082012, AFRICA, ARGENTINA, 27, 6, 25082012, New Zealand, AUSTRALIA, 22, 0 25082012 , ARGENTINA, SOUTH AFRICA, 08092012,08092012 16.16, AUSTRALIA, SOUTH AFRICA, 26, 19, 08092012, New Zealand, ARGENTINA, 21, 5 15092012, AUSTRALIA, ARGENTINA, 15092012,15092012, NEW ZEALAND, AFRICA, 29092012, SOUTH AUSTRALIA, 29092012 AFRICA, ARGENTINA, New Zealand, 06102012,06102012, AFRICA, New Zealand, 06102012, ARGENTINA, AUSTRALIA, thank you...

Apply function to_char sysdate to bring it to the same format as play_date. See below:

DOWNLOAD THE DATA

INFILE 'd:\fix.txt '.

TABLE OF RESULTS

ADD COMPLETED FIELDS BY «,»

TRAILING NULLCOLS

(

fixture_date DATE "DDMMYYYY"

play_date DATE "DDMMYYYY" "NVL (:play_date,to_char(sysdate,'DDMMYYYY')),"

home_team,

away_team,

home_points "NVL(:home_points,0)"

away_points "NVL(:away_points,0)".

)

Tags: Database

Similar Questions

  • SQL loader, problem with the POSITION & 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.

  • SQL Loader problem

    Hi I'm using version 11.2.0.3.0 version of oracle, and I'm trying to push the file using sql loader utility to my DB table, below is my table structure, two of the column will be constant appears as mentioned below in the table structure. And the File_DATE column must be the combination of two fields (Date and time) of flat file to have the appropriate data column format. I get the error message and not be able to download the data using slot control file, so need help.

    sample data file

    OrderDate, name, size, Records, Date, Time
    06202014, authlogfile06202014.txt, 40777214, 198915, June 21 at 03:51
    06202014, transferfile06202014.txt, 372144, 2255, June 21 at 01:34
    06202014, balancefile06202014.txt, 651075, 10343, June 21 at 03:28

    The table structure

    Create the table file_stats
    (Systemtypecode VARCHAR2 (4000)-this will be a value to hardcode "CBD")
    LETTER Date,
    FILENAME VARCHAR2 (4000).
    Size of the file Number (20.0).
    Noofrecords NUMBER (20.0).
    File_DATE VARCHAR2 (4000).
    CREATED_DATE Date - it will be filled with the value SYSDATE
    );

    Here's my control file

    Options
    (SKIP = 1)
    DOWNLOAD THE DATA
    INFILE 'files.csv '.
    ADD
    IN the file_stats table
    FIELDS TERMINATED BY ', '.
    (Systemtypecode CONSTANT 'CBD',
    LETTER DATE 'MMDDYYYY.
    CHAR FILE NAME,
    Size of the ENTIRE file,
    Noofrecords INTEGER,
    boundfiller TANK file_DATE_DDmon
    , file_DATE ' to_date ('2014':: file_DATE_DDmon:: file_DATE, 'YYYYMON DDHH24:MI').
    , created_date CONSTANT 'sysdate.
    )

    When running under command, all erroneous records on as below

    sqlldr schema1/pwd@db1 control = file_stats.ctl log = file_stats.log file_stats.bad = bad

    ERROR:
    Sheet 1: Rejected - error on the table FILE_STATS, column FILE_DATE.
    ORA-01843: not one month valid

    You must add TRAILING NULLCOLS and use EXTERNAL INTEGER instead of an INTEGER and your file_date column must be of type DATE data.  Please see the demo below with some additional corrections.  Note that since there is no year in the data file for the file_date column, which by default is the current year.  If you want to 2014 so you need to concatenate that and add the date format YYYY.

    Scott@orcl12c > files.csv TYPE of HOST

    OrderDate, name, size, Records, Date, Time

    06202014, authlogfile06202014.txt, 40777214, 198915, June 21 at 03:51

    06202014, transferfile06202014.txt, 372144, 2255, June 21 at 01:34

    06202014, balancefile06202014.txt, 651075, 10343, June 21 at 03:28

    Scott@orcl12c > file_stats.ctl TYPE of HOST

    OPTIONS (SKIP = 1)

    DOWNLOAD THE DATA

    INFILE 'files.csv '.

    ADD IN THE TABLE file_stats

    FIELDS TERMINATED BY ',' TRAILING NULLCOLS

    (systemtypecode CONSTANT "CBD"

    , odate DATE 'MMDDYYYY '.

    filename CHAR

    INTEGER EXTERNAL file size

    noofrecords INTEGER EXTERNAL

    file_date_ddmon BOUNDFILLER TANK

    , file_date DATE 'My DDHH24:MI' ': file_date_ddmon |: file_date '

    , created_date 'SYSDATE.

    )

    Scott@orcl12c > file_stats CREATE TABLE

    2 (systemtypecode VARCHAR2 (14),)

    3 DATE odate,.

    4 name of file VARCHAR2 (24).

    size of the file NUMBER 5 (20.0).

    6 noofrecords NUMBER (20.0).

    7 file_date DATE,

    8 created_date DATE)

    9.

    Table created.

    Scott@orcl12c > HOST SQLLDR scott/tiger CONTROL = file_stats.ctl LOG = file_stats.log file_stats.bad = BAD

    SQL * Loader: release 12.1.0.1.0 - Production on Thu Feb 5 15:26:49 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 3

    Table FILE_STATS:

    3 rows loaded successfully.

    Check the log file:

    file_stats.log

    For more information on the charge.

    Scott@orcl12c > SELECT * FROM file_stats

    2.

    SYSTEMTYPECODE, KAI NOOFRECORDS FILE_DATE CREATED_DATE FILENAME FILE SIZE

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

    Friday, June 20, 2014 authlogfile06202014.txt 40777214 198915 Sunday 21 June 2015 CBD Thursday, February 5, 2015

    Friday, June 20, 2014 transferfile06202014.txt 372144 2255 Sunday 21 June 2015 CBD Thursday, February 5, 2015

    Friday, June 20, 2014 balancefile06202014.txt 651075 10343 Sunday 21 June 2015 CBD Thursday, February 5, 2015

    3 selected lines.

  • SQL Loader: Problem with WHEN

    I'm using Oracle 11 g, Win XP.

    I'm trying to load data with control below folder:
    OPTIONS (SKIP=0, DIRECT=FALSE, PARALLEL=FALSE, BINDSIZE=50000, errors=999999,ROWS=200, READSIZE=65536)
    LOAD DATA
    
    APPEND
    INTO TABLE v_table
    when COL_3  = 'XXXX'
    fields terminated by "|" optionally enclosed by '"'
    trailing nullcols
    (
    COL_1  "trim(:COL_1)",
    COL_2  "trim(:COL_2)",
    COL_3  "trim(:COL_3)",
    COL_4  "trim(:COL_4)",
    COL_5  "trim(:COL_5)",
    COL_6  "trim(:COL_6)",
    COL_7  "trim(:COL_7)",
    )
    
    INTO TABLE v_table
    APPEND
    when  COL_3 = 'YYY'
    fields terminated by "|" optionally enclosed by '"'
    trailing nullcols
    (
    COL_1  "trim(:COL_1)",
    COL_2  "trim(:COL_2)",
    COL_3  "trim(:COL_3)",
    COL_4  "trim(:COL_4)",
    COL_5  "trim(:COL_5)",
    COL_6  "trim(:COL_6)",
    COL_7  "trim(:COL_7)",
    )
    Here is the sample data in the data file:
    33432|"ORACLE"|"XXXX"|"555827             "|"317564"|" "|""|"ORACLE "|2011-07-20-15.37.11.879915|0001-01-01-01.01.01.000001
    33433|"ORACLE"|"XXXX"|"555828             "|"317564"|" "|""|"ORACLE "|2011-07-24-15.37.11.879915|0001-01-01-01.01.01.000001
    33434|"ORACLE"|"XXXX"|"555829             "|"317564"|" "|""|"ORACLE "|2011-07-10-15.37.11.879915|0001-01-01-01.01.01.000001
    33435|"ORACLE"|"XXXX"|"555830             "|"317564"|" "|""|"ORACLE "|2011-07-22-15.37.11.879915|0001-01-01-01.01.01.000001
    33436|"ORACLE"|"XXXX"|"555831             "|"317564"|" "|""|"ORACLE "|2011-07-20-15.37.11.879915|0001-01-01-01.01.01.000001
    33437|"ORACLE"|"XXXX"|"555832             "|"317564"|" "|""|"ORACLE "|2011-07-20-15.37.11.879915|0001-01-01-01.01.01.000001
    40048|"SAS"|"ZZZ "|"1017838            "|"317551"|" "|""|"COD "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
    40049|"SAS"|"ZZZ "|"1017839            "|"317551"|" "|""|"COD "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
    40050|"SAS"|"ZZZ "|"1017840            "|"317551"|" "|""|"COD "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
    20046|"SUNUSA"|"YYY "|"1017836            "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
    20047|"SUNUSA"|"YYY "|"1017837            "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
    20048|"SUNUSA"|"YYY "|"1017838            "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
    20049|"SUNUSA"|"YYY "|"1017839            "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
    20050|"SUNUSA"|"YYY "|"1017840            "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
    It is:
    When I'm loading data into the table with the above command card, only data with when COL_3 = "XXXX" is to take. And if I comment the block that has COL_3 = "XXXX", then the second block is to take (when COL_3 = "YYY"). But I am unable to load data for XXXX and YYY on a single charge. Can someone help me on this please?

    This give a try.

      ...
      when  COL_3  = 'XXXX' and COL_3 = 'YYY'
      ...
    
  • 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.

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

  • Question to load data using sql loader in staging table, and then in the main tables!

    Hello

    I'm trying to load data into our main database table using SQL LOADER. data will be provided in separate pipes csv files.

    I have develop a shell script to load the data and it works fine except one thing.

    Here are the details of a data to re-create the problem.

    Staging of the structure of the table in which data will be filled using sql loader

    create table stg_cmts_data (cmts_token varchar2 (30), CMTS_IP varchar2 (20));

    create table stg_link_data (dhcp_token varchar2 (30), cmts_to_add varchar2 (200));

    create table stg_dhcp_data (dhcp_token varchar2 (30), DHCP_IP varchar2 (20));

    DATA in the csv file-

    for stg_cmts_data-

    cmts_map_03092015_1.csv

    WNLB-CMTS-01-1. 10.15.0.1

    WNLB-CMTS-02-2 | 10.15.16.1

    WNLB-CMTS-03-3. 10.15.48.1

    WNLB-CMTS-04-4. 10.15.80.1

    WNLB-CMTS-05-5. 10.15.96.1

    for stg_dhcp_data-

    dhcp_map_03092015_1.csv

    DHCP-1-1-1. 10.25.23.10, 25.26.14.01

    DHCP-1-1-2. 56.25.111.25, 100.25.2.01

    DHCP-1-1-3. 25.255.3.01, 89.20.147.258

    DHCP-1-1-4. 10.25.26.36, 200.32.58.69

    DHCP-1-1-5 | 80.25.47.369, 60.258.14.10

    for stg_link_data

    cmts_dhcp_link_map_0309151623_1.csv

    DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2

    DHCP-1-1-2. WNLB-CMTS-03-3,WNLB-CMTS-04-4,WNLB-CMTS-05-5

    DHCP-1-1-3. WNLB-CMTS-01-1

    DHCP-1-1-4. WNLB-CMTS-05-8,WNLB-CMTS-05-6,WNLB-CMTS-05-0,WNLB-CMTS-03-3

    DHCP-1-1-5 | WNLB-CMTS-02-2,WNLB-CMTS-04-4,WNLB-CMTS-05-7

    WNLB-DHCP-1-13 | WNLB-CMTS-02-2

    Now, after loading these data in the staging of table I have to fill the main database table

    create table subntwk (subntwk_nm varchar2 (20), subntwk_ip varchar2 (30));

    create table link (link_nm varchar2 (50));

    SQL scripts that I created to load data is like.

    coil load_cmts.log

    Set serveroutput on

    DECLARE

    CURSOR c_stg_cmts IS SELECT *.

    OF stg_cmts_data;

    TYPE t_stg_cmts IS TABLE OF stg_cmts_data % ROWTYPE INDEX BY pls_integer;

    l_stg_cmts t_stg_cmts;

    l_cmts_cnt NUMBER;

    l_cnt NUMBER;

    NUMBER of l_cnt_1;

    BEGIN

    OPEN c_stg_cmts.

    Get the c_stg_cmts COLLECT in BULK IN l_stg_cmts;

    BECAUSE me IN l_stg_cmts. FIRST... l_stg_cmts. LAST

    LOOP

    SELECT COUNT (1)

    IN l_cmts_cnt

    OF subntwk

    WHERE subntwk_nm = l_stg_cmts (i) .cmts_token;

    IF l_cmts_cnt < 1 THEN

    INSERT

    IN SUBNTWK

    (

    subntwk_nm

    )

    VALUES

    (

    l_stg_cmts (i) .cmts_token

    );

    DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_cmts (i) .cmts_token);

    ON THE OTHER

    DBMS_OUTPUT. Put_line ("token is already present'");

    END IF;

    WHEN l_stg_cmts EXIT. COUNT = 0;

    END LOOP;

    commit;

    EXCEPTION

    WHILE OTHERS THEN

    Dbms_output.put_line ('ERROR' |) SQLERRM);

    END;

    /

    output

    for dhcp


    coil load_dhcp.log

    Set serveroutput on

    DECLARE

    CURSOR c_stg_dhcp IS SELECT *.

    OF stg_dhcp_data;

    TYPE t_stg_dhcp IS TABLE OF stg_dhcp_data % ROWTYPE INDEX BY pls_integer;

    l_stg_dhcp t_stg_dhcp;

    l_dhcp_cnt NUMBER;

    l_cnt NUMBER;

    NUMBER of l_cnt_1;

    BEGIN

    OPEN c_stg_dhcp.

    Get the c_stg_dhcp COLLECT in BULK IN l_stg_dhcp;

    BECAUSE me IN l_stg_dhcp. FIRST... l_stg_dhcp. LAST

    LOOP

    SELECT COUNT (1)

    IN l_dhcp_cnt

    OF subntwk

    WHERE subntwk_nm = l_stg_dhcp (i) .dhcp_token;

    IF l_dhcp_cnt < 1 THEN

    INSERT

    IN SUBNTWK

    (

    subntwk_nm

    )

    VALUES

    (

    l_stg_dhcp (i) .dhcp_token

    );

    DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_dhcp (i) .dhcp_token);

    ON THE OTHER

    DBMS_OUTPUT. Put_line ("token is already present'");

    END IF;

    WHEN l_stg_dhcp EXIT. COUNT = 0;

    END LOOP;

    commit;

    EXCEPTION

    WHILE OTHERS THEN

    Dbms_output.put_line ('ERROR' |) SQLERRM);

    END;

    /

    output

    for link -.

    coil load_link.log

    Set serveroutput on

    DECLARE

    l_cmts_1 VARCHAR2 (4000 CHAR);

    l_cmts_add VARCHAR2 (200 CHAR);

    l_dhcp_cnt NUMBER;

    l_cmts_cnt NUMBER;

    l_link_cnt NUMBER;

    l_add_link_nm VARCHAR2 (200 CHAR);

    BEGIN

    FOR (IN) r

    SELECT dhcp_token, cmts_to_add | ',' cmts_add

    OF stg_link_data

    )

    LOOP

    l_cmts_1: = r.cmts_add;

    l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));

    SELECT COUNT (1)

    IN l_dhcp_cnt

    OF subntwk

    WHERE subntwk_nm = r.dhcp_token;

    IF l_dhcp_cnt = 0 THEN

    DBMS_OUTPUT. Put_line ("device not found: ' |") r.dhcp_token);

    ON THE OTHER

    While l_cmts_add IS NOT NULL

    LOOP

    l_add_link_nm: = r.dhcp_token |' _TO_' | l_cmts_add;

    SELECT COUNT (1)

    IN l_cmts_cnt

    OF subntwk

    WHERE subntwk_nm = TRIM (l_cmts_add);

    SELECT COUNT (1)

    IN l_link_cnt

    LINK

    WHERE link_nm = l_add_link_nm;

    IF l_cmts_cnt > 0 AND l_link_cnt = 0 THEN

    INSERT INTO link (link_nm)

    VALUES (l_add_link_nm);

    DBMS_OUTPUT. Put_line (l_add_link_nm |) » '||' Has been added. ") ;

    ELSIF l_link_cnt > 0 THEN

    DBMS_OUTPUT. Put_line (' link is already present: ' | l_add_link_nm);

    ELSIF l_cmts_cnt = 0 then

    DBMS_OUTPUT. Put_line (' no. CMTS FOUND for device to create the link: ' | l_cmts_add);

    END IF;

    l_cmts_1: = TRIM (SUBSTR (l_cmts_1, INSTR (l_cmts_1, ',') + 1));

    l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));

    END LOOP;

    END IF;

    END LOOP;

    COMMIT;

    EXCEPTION

    WHILE OTHERS THEN

    Dbms_output.put_line ('ERROR' |) SQLERRM);

    END;

    /

    output

    control files -

    DOWNLOAD THE DATA

    INFILE 'cmts_data.csv '.

    ADD

    IN THE STG_CMTS_DATA TABLE

    When (cmts_token! = ") AND (cmts_token! = 'NULL') AND (cmts_token! = 'null')

    and (cmts_ip! = ") AND (cmts_ip! = 'NULL') AND (cmts_ip! = 'null')

    FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    ('RTRIM (LTRIM (:cmts_token))' cmts_token,

    cmts_ip ' RTRIM (LTRIM(:cmts_ip)) ")". "

    for dhcp.


    DOWNLOAD THE DATA

    INFILE 'dhcp_data.csv '.

    ADD

    IN THE STG_DHCP_DATA TABLE

    When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')

    and (dhcp_ip! = ") AND (dhcp_ip! = 'NULL') AND (dhcp_ip! = 'null')

    FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    ('RTRIM (LTRIM (:dhcp_token))' dhcp_token,

    dhcp_ip ' RTRIM (LTRIM(:dhcp_ip)) ")". "

    for link -.

    DOWNLOAD THE DATA

    INFILE 'link_data.csv '.

    ADD

    IN THE STG_LINK_DATA TABLE

    When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')

    and (cmts_to_add! = ") AND (cmts_to_add! = 'NULL') AND (cmts_to_add! = 'null')

    FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    ('RTRIM (LTRIM (:dhcp_token))' dhcp_token,

    cmts_to_add TANK (4000) RTRIM (LTRIM(:cmts_to_add)) ")" ""

    SHELL SCRIPT-

    If [!-d / log]

    then

    Mkdir log

    FI

    If [!-d / finished]

    then

    mkdir makes

    FI

    If [!-d / bad]

    then

    bad mkdir

    FI

    nohup time sqlldr username/password@SID CONTROL = load_cmts_data.ctl LOG = log/ldr_cmts_data.log = log/ldr_cmts_data.bad DISCARD log/ldr_cmts_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &

    nohup time username/password@SID @load_cmts.sql

    nohup time sqlldr username/password@SID CONTROL = load_dhcp_data.ctl LOG = log/ldr_dhcp_data.log = log/ldr_dhcp_data.bad DISCARD log/ldr_dhcp_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &

    time nohup sqlplus username/password@SID @load_dhcp.sql

    nohup time sqlldr username/password@SID CONTROL = load_link_data.ctl LOG = log/ldr_link_data.log = log/ldr_link_data.bad DISCARD log/ldr_link_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &

    time nohup sqlplus username/password@SID @load_link.sql

    MV *.log. / log

    If the problem I encounter is here for loading data in the link table that I check if DHCP is present in the subntwk table, then continue to another mistake of the newspaper. If CMTS then left create link to another error in the newspaper.

    Now that we can here multiple CMTS are associated with unique DHCP.

    So here in the table links to create the link, but for the last iteration of the loop, where I get separated by commas separate CMTS table stg_link_data it gives me log as not found CMTS.

    for example

    DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2

    Here, I guess to link the dhcp-1-1-1 with balancing-CMTS-01-1 and wnlb-CMTS-02-2

    Theses all the data present in the subntwk table, but still it gives me journal wnlb-CMTS-02-2 could not be FOUND, but we have already loaded into the subntwk table.

    same thing is happening with all the CMTS table stg_link_data who are in the last (I think here you got what I'm trying to explain).

    But when I run the SQL scripts in the SQL Developer separately then it inserts all valid links in the table of links.

    Here, she should create 9 lines in the table of links, whereas now he creates only 5 rows.

    I use COMMIT in my script also but it only does not help me.

    Run these scripts in your machine let me know if you also get the same behavior I get.

    and please give me a solution I tried many thing from yesterday, but it's always the same.

    It is the table of link log

    link is already present: dhcp-1-1-1_TO_wnlb-cmts-01-1

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-02-2

    link is already present: dhcp-1-1-2_TO_wnlb-cmts-03-3
    link is already present: dhcp-1-1-2_TO_wnlb-cmts-04-4

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-5

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-01-1

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-8
    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-6
    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-0

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-03-3

    link is already present: dhcp-1-1-5_TO_wnlb-cmts-02-2
    link is already present: dhcp-1-1-5_TO_wnlb-cmts-04-4

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-7

    Device not found: wnlb-dhcp-1-13

    IF NEED MORE INFORMATION PLEASE LET ME KNOW

    Thank you

    I felt later in the night that during the loading in the staging table using UNIX machine he created the new line for each line. That is why the last CMTS is not found, for this I use the UNIX 2 BACK conversion and it starts to work perfectly.

    It was the dos2unix error!

    Thank you all for your interest and I may learn new things, as I have almost 10 months of experience in (PLSQL, SQL)

  • SQL * Loader does not import data

    Hi all -

    I have a very basic package which should load data from a file delimited by tabs.  My problem is that when I run my package, no data is loaded. Although the correct number of records is created (based on relaxation of the table).  All records contain no data.

    OPTIONS (skip = 1, errors = 10, lines = 10000, direct = True)

    DOWNLOAD THE DATA

    INFILE "C:\ECOMMERCE\VFT\Marin\inbound\DSGSiteCatalystPassbackKeywords.csv" "str"\n"

    BADFILE "C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_KEYWORDS.bad."

    DISCARDFILE 'C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_KEYWORDS.dsc '.

    IN THE TABLE "ETL_STAGE". "" MARIN_KEYWORD ".

    ADD

    EVALUATE CHECK_CONSTRAINTS

    "FIELDS TERMINATED BY ' 09 X."

    TRAILING NULLCOLS

    (

    MARIN_KEYWORD_ID,

    KEYWORD,

    BUSINESS_DATE,

    EDITOR,

    ACCOUNT,

    CAMPAIGN,

    AD_GROUP,

    TYPE CHAR (100000),

    DESTINATION_URL,

    UNIQUE_ID,

    PUB_ID,

    PRINT,

    CLICKS,

    PUB_COST,

    ATTRIBUTED_CONVERSIONS_CONV,

    CLICK_PATH_CONV,

    LAST_CLICK_CONV,

    EMAIL_SIGNUPS_CONV,

    SCORECARD_SIGNUPS_CONV,

    STORE_LOCATOR_PAGE_CONV

    )

    My table creation script is:

    CREATE THE TABLE ETL_STAGE. MARIN_KEYWORD

    (

    MARIN_KEYWORD_ID VARCHAR2 (1000 BYTE),

    KEYWORD VARCHAR2 (1000 BYTE).

    BUSINESS_DATE VARCHAR2 (200 BYTE),

    EDITOR VARCHAR2 (1000 BYTE),

    ACCOUNT VARCHAR2 (1000 BYTE),

    CAMPAIGN VARCHAR2 (1000 BYTE),

    AD_GROUP VARCHAR2 (1000 BYTE),

    TYPE VARCHAR2 (1000 BYTE),

    DESTINATION_URL VARCHAR2 (1000 BYTE),

    UNIQUE_ID VARCHAR2 (1000 BYTE),

    PUB_ID VARCHAR2 (1000 BYTE),

    VARCHAR2 (1000 BYTE) PRINT,

    VARCHAR2 (1000 BYTE) CLICKS,

    PUB_COST VARCHAR2 (1000 BYTE),

    ATTRIBUTED_CONVERSIONS_CONV VARCHAR2 (1000 BYTE),

    CLICK_PATH_CONV VARCHAR2 (1000 BYTE),

    LAST_CLICK_CONV VARCHAR2 (1000 BYTE),

    EMAIL_SIGNUPS_CONV VARCHAR2 (1000 BYTE),

    SCORECARD_SIGNUPS_CONV VARCHAR2 (1000 BYTE),

    STORE_LOCATOR_PAGE_CONV VARCHAR2 (1000 BYTE),

    IMEX_LOG_REFERENCE_ID VARCHAR2 (1000 BYTE),

    DATE_ADDED DATE DEFAULT SYSDATE NOT NULL,.

    ADDED_BY VARCHAR2 (50 BYTES) BY DEFAULT USER NOT NULL,.

    DATE_LAST_MODIFIED DATE DEFAULT SYSDATE NOT NULL,.

    MODIFIED_BY VARCHAR2 (50 BYTES) BY DEFAULT USER NOT NULL,.

    RECORD_STATUS VARCHAR2 (1 BYTE) DEFAULT 'A' NOT NULL

    )

    TABLESPACE ECOM_DATA

    PCTUSED 0

    PCTFREE 10

    INITRANS 1

    MAXTRANS 255

    STORAGE)

    64K INITIALS

    ACCORDING TO 1 M

    MINEXTENTS 1

    MAXEXTENTS UNLIMITED

    PCTINCREASE 0

    DEFAULT USER_TABLES

    )

    LOGGING

    NOCOMPRESS

    NOCACHE

    NOPARALLEL

    MONITORING;

    The log displays the following text:

    SQL * Loader: release 11.2.0.2.0 - Production on Thu Jun 25 14:31:35 2015

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

    Control file: C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\SQLLoaderScripts\MARIN_DSG_CREATIVES.ctl

    Data file: C:\ECOMMERCE\VFT\Marin\inbound\DSGSiteCatalystPassbackCreatives.csv

    Bad leadership: C:\\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_CREATIVES.bad

    Delete the file: C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_CREATIVES.dsc

    (Allow all releases)

    Number of loading: ALL

    Number of jump: 10

    Authorized errors: 50

    Link table: 64 lines, maximum of 256000 bytes

    Continuation of the debate: none is specified

    Path used: classics

    Table 'ETL_STAGE '. "" MARIN_CREATIVE ", 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

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

    CREATIVE_ID PRIME * WHT O(") CHARACTER

    The maximum field length is 100,000

    HEADLINE THEN * CHARACTER O(") WHT

    BUSINESS_DATE NEXT * CHARACTER O(") WHT

    The SQL string for the column: 'TRIM(:BUSINESS_DATE) '.

    DESCRIPTION_LINE_1 NEXT * CHARACTER O(") WHT

    DESCRIPTION_LINE_2 NEXT * CHARACTER O(") WHT

    DISPLAY_URL NEXT * CHARACTER O(") WHT

    DESTINATION_URL NEXT * WHT O(") CHARACTER

    The maximum field length is 100,000

    EDITOR NEXT * CHARACTER O(") WHT

    THEN THE CAMPAIGN * CHARACTER O(") WHT

    AD_GROUP NEXT * CHARACTER O(") WHT

    UNIQUE_ID NEXT * CHARACTER O(") WHT

    PUB_ID NEXT * CHARACTER O(") WHT

    PRINT NEXT * CHARACTER O(") WHT

    The SQL string for the column: "replace (: print, ',',") "."

    CLICK ON NEXT * CHARACTER O(") WHT

    The SQL string for the column: "replace (: CLICKS, ',',") "."

    ATTRIBUTED_CONVERSIONS_CONV NEXT * CHARACTER O(") WHT

    CLICK_PATH_CONV NEXT * CHARACTER O(") WHT

    LAST_CLICK_CONV NEXT * CHARACTER O(") WHT

    EMAIL_SIGNUPS_CONV NEXT * CHARACTER O(") WHT

    SCORECARD_SIGNUPS_CONV NEXT * CHARACTER O(") WHT

    STORE_LOCATOR_PAGE_HITS_CONV NEXT * CHARACTER O(") WHT

    IMEX_LOG_REFERENCE_ID NEXT * CHARACTER O(") WHT

    Why WHT, showing when I use tabs?

    In addition, why is not display all the data in the files?

    NLS_CHARACTERSET WE8ISO8859P1
  • SQL Loader loading data into two Tables using a single CSV file

    Dear all,

    I have a requirement where in I need to load the data into 2 tables using a simple csv file.

    So I wrote the following control file. But it loads only the first table and also there nothing in the debug log file.

    Please suggest how to achieve this.

    Examples of data

    Source_system_code,Record_type,Source_System_Vendor_number,$vendor_name,Vendor_site_code,Address_line1,Address_line2,Address_line3

    Victor, New, Ven001, Vinay, Vin001, abc, def, xyz

    Control file script

    ================

    OPTIONS (errors = 0, skip = 1)
    load data
    replace
    in the table1 table:
    fields ended by ',' optionally surrounded "" "
    (
    Char Source_system_code (1) POSITION "ltrim (rtrim (:Source_system_code)),"
    Record_type tank "ltrim (rtrim (:Record_type)),"
    Source_System_Vendor_number tank "ltrim (rtrim (:Source_System_Vendor_number)),"
    $vendor_name tank "ltrim (rtrim (:Vendor_name)),"
    )
    in the Table2 table
    1 = 1
    fields ended by ',' optionally surrounded "" "
    (
    $vendor_name tank "ltrim (rtrim (:Vendor_name)),"
    Vendor_site_code tank "ltrim (rtrim (:Vendor_site_code)),"
    Address_line1 tank "ltrim (rtrim (:Address_line1)),"
    Address_line2 tank "ltrim (rtrim (:Address_line2)),"
    Address_line3 tank "ltrim (rtrim (:Address_line3)).
    )

    the problem here is loading into a table, only the first. (Table 1)

    Please guide me.

    Thank you

    Kumar

    When you do not provide a starting position for the first field in table2, it starts with the following after a last referenced in table1 field, then it starts with vendor_site_code, instead of $vendor_name.  So what you need to do instead, is specify position (1) to the first field in table2 and use the fields to fill.  In addition, he dislikes when 1 = 1, and he didn't need anyway.  See the example including the corrected below control file.

    Scott@orcl12c > test.dat TYPE of HOST

    Source_system_code, Record_type, Source_System_Vendor_number, $vendor_name, Vendor_site_code, Address_line1, Address_line2, Address_line3

    Victor, New, Ven001, Vinay, Vin001, abc, def, xyz

    Scott@orcl12c > test.ctl TYPE of HOST

    OPTIONS (errors = 0, skip = 1)

    load data

    replace

    in the table1 table:

    fields ended by ',' optionally surrounded "" "

    (

    Char Source_system_code (1) POSITION "ltrim (rtrim (:Source_system_code)),"

    Record_type tank "ltrim (rtrim (:Record_type)),"

    Source_System_Vendor_number tank "ltrim (rtrim (:Source_System_Vendor_number)),"

    $vendor_name tank "ltrim (rtrim (:Vendor_name)).

    )

    in the Table2 table

    fields ended by ',' optionally surrounded "" "

    (

    source_system_code FILL (1) POSITION.

    record_type FILLING,

    source_system_vendor_number FILLING,

    $vendor_name tank "ltrim (rtrim (:Vendor_name)),"

    Vendor_site_code tank "ltrim (rtrim (:Vendor_site_code)),"

    Address_line1 tank "ltrim (rtrim (:Address_line1)),"

    Address_line2 tank "ltrim (rtrim (:Address_line2)),"

    Address_line3 tank "ltrim (rtrim (:Address_line3)).

    )

    Scott@orcl12c > CREATE TABLE table1:

    2 (Source_system_code VARCHAR2 (13),)

    3 Record_type VARCHAR2 (11),

    4 Source_System_Vendor_number VARCHAR2 (27),

    5 $vendor_name VARCHAR2 (11))

    6.

    Table created.

    Scott@orcl12c > CREATE TABLE table2

    2 ($vendor_name VARCHAR2 (11),)

    3 Vendor_site_code VARCHAR2 (16).

    4 Address_line1 VARCHAR2 (13),

    5 Address_line2 VARCHAR2 (13),

    Address_line3 6 VARCHAR2 (13))

    7.

    Table created.

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

    SQL * Loader: release 12.1.0.1.0 - Production on Thu Mar 26 01:43:30 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

    TABLE1 table:

    1 row loaded successfully.

    Table TABLE2:

    1 row loaded successfully.

    Check the log file:

    test.log

    For more information on the charge.

    Scott@orcl12c > SELECT * FROM table1

    2.

    RECORD_TYPE SOURCE_SYSTEM_VENDOR_NUMBER $VENDOR_NAME SOURCE_SYSTEM

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

    Victor Ven001 new Vinay

    1 selected line.

    Scott@orcl12c > SELECT * FROM table2

    2.

    $VENDOR_NAME VENDOR_SITE_CODE ADDRESS_LINE1 ADDRESS_LINE2 ADDRESS_LINE3

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

    Vinay Vin001 abc def xyz

    1 selected line.

    Scott@orcl12c >

  • Reg: Problem SQL Loader-

    Hi Experts,

    I am trying to load data from a flat file in an Oracle table, but face some problems.

    Concern (1) (1)

    I have a directory where there are about 20 similar files named as 'rb_1', 'rb_2', 'rb_3', etc...

    All these data should be loaded in a Word only table 'X '.

    Is it possible that only 1 CTL file will make a loop and load all the files in X?

    Concern (2) (2)

    Field delimiter is Ctrl-X (CAN: cancel) and Ctrl-M (EM: em) characters

    Line delimiter is Ctrl-Z (SUB: substitute) and Ctrl-T (DC4: Device Control) characters

    Is there a way I can specify this in my CTL file?

    (I've only worked on delimiter of field as comma "«»", de champ comme virgule «», pas speciales personnages comme ca not special characters like that)

    Please let me know if any additional information is required.

    Help much appreciated.

    Thank you

    -Nordine


    Agree with Hoek, you'd better to use external tables you can specify multiple filenames at once, otherwise you will have a script that provides the name of the input file when calling sql loader and make this script loop for each file.

    Regarding the ctrl characters in your delimiters, control file supports the hexagonal versions of them for example

    fields terminated by ' 09 x. "

    where 9 is the hexagon of the ascii value of the character (in this case a tab character).

    CTRL-m, that would be x ' 0 of etc.

  • Problem with Sql Loader

    Hi s/n,.

    I am facing problems when loading the dates in the database by using sql loader. My data file can have several date formats, so I have a function that interprets date and removes the time settings and the date of return.

    Something like that.

    For example:

    I have a table-

    CREATE TABLE TEMP1234

    (

    IDENTIFICATION NUMBER,

    DATE OF ASOF_DATE

    );

    Data file

    10001172 | 09/12/1945

    Control file:

    OPTIONS (DIRECT = TRUE, SILENT (FEEDBACK) =, skip = 0)

    DATA RELATING TO SUNK COSTS

    REPLACE

    in the temp1234 table

    ' fields completed by "|" possibly provided by ' "'

    TRAILING NULLCOLS

    (ID,

    ASOF_DATE "decode (: ASOF_DATE, null,:ASOF_DATE,conv_date1(:ASOF_DATE))).

    )

    Function CONV_DATE1:

    FUNCTION to CREATE or REPLACE conv_date1 (p_str IN VARCHAR2)
    DATE OF RETURN
    IS
    RETURN_VALUE DATE;

    p_str1 VARCHAR2 (15): = NULL;

    FmtArray TYPE IS a TABLE OF VARCHAR2 (30);

    g_fmts fmtArray
    : = fmtArray ("yyyy-mm-dd",
    "yyyy/mm/dd"
    mm/dd/yyyy"."
    "dd-mm-yyyy",
    "dd/mm/yyyy",
    "mm-dd-yyyy");
    BEGIN
    p_str1: = SUBSTR (p_str, 1, 10);

    BECAUSE me in 1... g_fmts. COUNTY
    LOOP
    BEGIN
    return_value: = TO_DATE (p_str1, g_fmts (i));
    EXIT;
    EXCEPTION
    WHILE OTHERS
    THEN
    NULL;
    END;
    END LOOP;

    IF (return_value IS NULL)
    THEN
    RAISE PROGRAM_ERROR;
    END IF;

    RETURN Return_value;
    END;
    /

    In this case, if the year in the data file shown in 1945, date which is load in the poster 2045 database.

    But when I run this function by putting a sql editor - it returns the correct value.

    Select double conv_date1('12/09/1945');

    Please help me understand what is causing the problem.

    I think there may be an implicit conversion going on with the combination of decode and checking nvl and function within SQL * Loader.  I put the nvl checking in function and simply use the function in the control file, as shown below.

    OPTIONS (DIRECT = TRUE, SILENT (FEEDBACK) =, skip = 0)

    DATA RELATING TO SUNK COSTS

    REPLACE

    in the temp1234 table

    ' fields completed by "|" possibly provided by ' "'

    TRAILING NULLCOLS

    (ID,

    asof_date ' conv_date1 (: asof_date).

    )

    FUNCTION to CREATE or REPLACE conv_date1 (p_str IN VARCHAR2)

    DATE OF RETURN

    IS

    RETURN_VALUE DATE;

    p_str1 VARCHAR2 (15): = NULL;

    FmtArray TYPE IS a TABLE OF VARCHAR2 (30);

    g_fmts fmtArray

    : = fmtArray ("yyyy-mm-dd",

    "yyyy/mm/dd"

    mm/dd/yyyy"."

    "dd-mm-yyyy",

    "dd/mm/yyyy",

    "mm-dd-yyyy");

    BEGIN

    IF p_str IS NULL

    THEN RETURN NULL;

    ON THE OTHER

    p_str1: = SUBSTR (p_str, 1, 10);

    BECAUSE me in 1... g_fmts. COUNTY

    LOOP

    BEGIN

    return_value: = TO_DATE (p_str1, g_fmts (i));

    EXIT;

    EXCEPTION

    WHILE OTHERS

    THEN

    NULL;

    END;

    END LOOP;

    IF (return_value IS NULL)

    THEN

    RAISE PROGRAM_ERROR;

    END IF;

    RETURN Return_value;

    END IF;

    END;

    /

  • SQL Loader failed to load the same source sometimes data file

    I meet different types of data, loading errors when you try to load data. What makes it really annoying, is that I'm not able to identify the real culprit since the success of load depends on the amount of lines in the source data file but not its content. I use dataset Toad export feature to create delimited data set. When I decided to take the first 50 lines then succeeds data to load into the target table. When I decide to take the first 150 lines then the data to load into the target table fails indicating that:
    Record 13: Rejected - Error on table ISIKUD, column SYNLAPSI.
    ORA-01722: invalid number
    I can see .bad file that the same line has been loaded successfully when the data file that contains 50 rows was used. The content has no column for this particular row is NULL (no chain).
    I suspect that the toad generates faulty delimited text file when taking 150 lines. File data for reasons of confidentiality, I can't show. What can I do? How can we all further investigate this problem? Size of the array that must be loaded by SQL Loader is almost 600 MB. I use Windows XP.

    Published by: totalnewby on June 30, 2012 10:17

    I do not believe that customer sqlloader 11g allows you to load a 10g database. You can run sqlldr on the server of database 10g itself? PL also post the rest I asked information

    HTH
    Srini

  • How to handle multiple formats of date to the same date field in SQL * Loader

    Dear all,

    I have a requirement where I need to get data from a text file and even insert into the oracle table.

    I'm using SQL * Loader to fill data from the text file in my table.

    The file has an area where I expect to date data date in different formats, such as MON/dd/yyyy mon/dd/yyyy mon/dd/yyyy, dd/mm/yyyy, DD/month/yyyy.

    When you use SQL * Loader, I can see loading fails for records where we have formats such as LUN/jj/aaaa, Mon/dd/yyyy, DD/month/yyyy.

    Is it possible in SQL * Loader where we can mention all these date formats so that data from that date should go smoothly in the underlying date column in the table.

    Receive your answer on that.

    Thank you
    Madhu K.

    I think following could be the solution to your problem:

    Suppose if you have data from four different date formats, you need to load the data into four different tables by running SQL * Loader four times and each time specify other date format in the control file whose data to load, and then at the end, merge data from these four different tables using the UNION clause.

    Elya

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

  • Loading data with sql loader

    Hi Experts,

    I have a file in the following format. I have to insert the data from these files in a table. Can I use SQL Loader to load these files.

    My question is that I need to schedule the download of these files. Can I integrate sql loader in a procedure?
    Agent Id|Agent Type|Create Date|Termination CDC|Activation CDC|Deactivation CDC|Agent IdX|Agent Status|Status Date|Status Reason Code|Update CDC|Update Serial|Update User|New Owner Agent Id|Previous Owner Agent Id|Agent Name|Primary Address1|Primary Address2|Primary Address3|Secondary Address1|Secondary Address2|Secondary Address3| Primary City|Primary State|Primary Zip|Primary Zip Suffix|Primary Country|Secondary City|Secondary State|Secondary Zip|Secondary Zip Suffix|Secondary Country|Phone Number|Fax number|Mobile Number|Business Type|Field Rep|Bill to Chain Id|Mon Open Time|Mon Close Time|Tue Open Time|Tue Close Time|Wed Open Time|Wed Close Time|Thu Open Time|Thu Close Time|Fri Open Time|Fri Close Time|Sat Open Time|Sat Close Time|Sun Open Time|Sun Close Time|Zone Id|Line Charge Class|Chain Id|Chain Code| Primary Contact  Name| Primary Contact Title| Primary Contact Phone|Secondary Contact Name|Secondary Contact Title|Secondary Contact Phone|Tertiary contact Name|Tertiary Contact Title|Tertiary Contact Phone| Bank Id| Bank Account Id| bank Account Type| Bank Account Date| EFT Flag| Fund Limit|Invoicable|TaxCode|Tax Id|Sales Tax|Service Charge|Instant Cashing Type|Instant Telsel Rep| Instant Number of Bins| Instant Number Itvms| InstantCredit Limit|Auto Reorder| Instant Terminal Reorder| Instant Telsel Reorder| Instant Teleset Active CDC| Instant Initial Distribution|Auto Telsel Schedule| Instant Auto Settle| Instant Call Day| Instant Call Week| Instant Call Cycle| Instant Order Restriction| Instant Delivery Flag| Instant Account Type| Instant Settle Class| Region|County|Territory|Route|Chain Statement|Master Agent Id| Minority Owned| Tax Name| State Tax Id|Mailing Name| Bank Account Name| DSR
    0|1|0|0|0|0|0|1|0|0|302|0|0|0|0|||||||||||||||||||||0|0|0|||||||||||||||0|0|0|||||||||||||0|-2145916800|0|0|0|0||0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0||0|0|0|||||
    1|1|1256213087|0|-39081|-39081|1|2|1256213087|999|302|0|0|0|0|Pseudo Outlet||||||||MU|||MU||MU|||MU||||0|0|1|06:00|23:59|06:00|23:59|06:00|23:59|06:00|23:59|06:00|23:59|06:00|23:59|06:00|23:59|0|0|0|||||||||||||
    {code)
    
    Edited by: Kevin CK on 02-Feb-2010 03:28                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Here you go...

    drop table agent_dump_csv_temp
    /
    
    create table agent_dump_csv_temp
      (Agent_Id                   NUMBER
      ,Agent_Type                 NUMBER
      ,Create_Date                NUMBER
      ,Termination_CDC            NUMBER
      ,Activation_CDC             NUMBER
      ,Deactivation_CDC           NUMBER
      ,Agent_IdX                  NUMBER
      ,Agent_Status               NUMBER
      ,Status_Date                NUMBER
      ,Status_Reason_Code         NUMBER
      ,Update_CDC                 NUMBER
      ,Update_Serial              NUMBER
      ,Update_User                NUMBER
      ,New_Owner_Agent_Id         NUMBER
      ,Previous_Owner_Agent_Id    NUMBER
      ,Agent_Name                 VARCHAR2(50)
      ,Primary_Address1           VARCHAR2(50)
      ,Primary_Address2           VARCHAR2(50)
      ,Primary_Address3           VARCHAR2(50)
      ,Secondary_Address1         VARCHAR2(50)
      ,Secondary_Address2         VARCHAR2(50)
      ,Secondary_Address3         VARCHAR2(50)
      ,Primary_City               VARCHAR2(50)
      ,Primary_State              VARCHAR2(50)
      ,Primary_Zip                VARCHAR2(50)
      ,Primary_Zip_Suffix         VARCHAR2(50)
      ,Primary_Country            VARCHAR2(50)
      ,Secondary_City             VARCHAR2(50)
      ,Secondary_State            VARCHAR2(50)
      ,Secondary_Zip              VARCHAR2(50)
      ,Secondary_Zip_Suffix       VARCHAR2(50)
      ,Secondary_Country          VARCHAR2(50)
      ,Phone_Number               VARCHAR2(50)
      ,Fax_number                 VARCHAR2(50)
      ,Mobile_Number              VARCHAR2(50)
      ,Business_Type              NUMBER
      ,Field_Rep                  NUMBER
      ,Bill_to_Chain_Id           NUMBER
      ,Mon_Open_Time              VARCHAR2(5)
      ,Mon_Close_Time             VARCHAR2(5)
      ,Tue_Open_Time              VARCHAR2(5)
      ,Tue_Close_Time             VARCHAR2(5)
      ,Wed_Open_Time              VARCHAR2(5)
      ,Wed_Close_Time             VARCHAR2(5)
      ,Thu_Open_Time              VARCHAR2(5)
      ,Thu_Close_Time             VARCHAR2(5)
      ,Fri_Open_Time              VARCHAR2(5)
      ,Fri_Close_Time             VARCHAR2(5)
      ,Sat_Open_Time              VARCHAR2(5)
      ,Sat_Close_Time             VARCHAR2(5)
      ,Sun_Open_Time              VARCHAR2(5)
      ,Sun_Close_Time             VARCHAR2(5)
      ,Zone_Id                    NUMBER
      ,Line_Charge_Class          NUMBER
      ,Chain_Id                   NUMBER
      ,Chain_Code                 NUMBER
      ,Primary_Contact_Name       VARCHAR2(50)
      ,Primary_Contact_Title      VARCHAR2(50)
      ,Primary_Contact_Phone      VARCHAR2(50)
      ,Secondary_Contact_Name     VARCHAR2(50)
      ,Secondary_Contact_Title    VARCHAR2(50)
      ,Secondary_Contact_Phone    VARCHAR2(50)
      ,Tertiary_contact_Name      VARCHAR2(50)
      ,Tertiary_Contact_Title     VARCHAR2(50)
      ,Tertiary_Contact_Phone     VARCHAR2(50)
      ,Bank_Id                    NUMBER
      ,Bank_Account_Id            NUMBER
      ,Bank_Account_Type          NUMBER
      ,Bank_Account_Date          NUMBER
      ,EFT_Flag                   NUMBER
      ,Fund_Limit                 NUMBER
      ,Invoicable                 NUMBER
      ,TaxCode                    NUMBER
      ,Tax_Id                     NUMBER
      ,Sales_Tax                  NUMBER
      ,Service_Charge             NUMBER
      ,Instant_Cashing_Type       NUMBER
      ,Instant_Telsel_Rep         NUMBER
      ,Instant_Number_of_Bins     NUMBER
      ,Instant_Number_Itvms       NUMBER
      ,InstantCredit_Limit        NUMBER
      ,Auto_Reorder               NUMBER
      ,Instant_Terminal_Reorder   NUMBER
      ,Instant_Telsel_Reorder     NUMBER
      ,Instant_Teleset_Active_CDC NUMBER
      ,Instant_Initial_Distribution NUMBER
      ,Auto_Telsel_Schedule       NUMBER
      ,Instant_Auto_Settle        NUMBER
      ,Instant_Call_Day           NUMBER
      ,Instant_Call_Week          NUMBER
      ,Instant_Call_Cycle         NUMBER
      ,Instant_Order_Restriction  NUMBER
      ,Instant_Delivery_Flag      NUMBER
      ,Instant_Account_Type       NUMBER
      ,Instant_Settle_Class       NUMBER
      ,Region                     NUMBER
      ,County                     NUMBER
      ,Territory_x                NUMBER
      ,Route                      NUMBER
      ,Chain_Statement            NUMBER
      ,Master_Agent_Id            NUMBER
      ,Minority_Owned             NUMBER
      ,Tax_Name                   VARCHAR2(50)
      ,State_Tax_Id               NUMBER
      ,Mailing_Name               VARCHAR2(50)
      ,Bank_Account_Name          VARCHAR2(50)
      ,DSR                        NUMBER
      )
      ORGANIZATION EXTERNAL (
       TYPE oracle_loader
        DEFAULT DIRECTORY TEST_DIR
        ACCESS PARAMETERS (
          RECORDS DELIMITED BY NEWLINE
          SKIP 1
          BADFILE 'test.bad'
          DISCARDFILE 'test.dis'
          LOGFILE 'test.log'
          FIELDS TERMINATED BY '|'
          MISSING FIELD VALUES ARE NULL
          REJECT ROWS WITH ALL NULL FIELDS
            (Agent_Id
            ,Agent_Type
            ,Create_Date
            ,Termination_CDC
            ,Activation_CDC
            ,Deactivation_CDC
            ,Agent_IdX
            ,Agent_Status
            ,Status_Date
            ,Status_Reason_Code
            ,Update_CDC
            ,Update_Serial
            ,Update_User
            ,New_Owner_Agent_Id
            ,Previous_Owner_Agent_Id
            ,Agent_Name
            ,Primary_Address1
            ,Primary_Address2
            ,Primary_Address3
            ,Secondary_Address1
            ,Secondary_Address2
            ,Secondary_Address3
            ,Primary_City
            ,Primary_State
            ,Primary_Zip
            ,Primary_Zip_Suffix
            ,Primary_Country
            ,Secondary_City
            ,Secondary_State
            ,Secondary_Zip
            ,Secondary_Zip_Suffix
            ,Secondary_Country
            ,Phone_Number
            ,Fax_number
            ,Mobile_Number
            ,Business_Type
            ,Field_Rep
            ,Bill_to_Chain_Id
            ,Mon_Open_Time
            ,Mon_Close_Time
            ,Tue_Open_Time
            ,Tue_Close_Time
            ,Wed_Open_Time
            ,Wed_Close_Time
            ,Thu_Open_Time
            ,Thu_Close_Time
            ,Fri_Open_Time
            ,Fri_Close_Time
            ,Sat_Open_Time
            ,Sat_Close_Time
            ,Sun_Open_Time
            ,Sun_Close_Time
            ,Zone_Id
            ,Line_Charge_Class
            ,Chain_Id
            ,Chain_Code
            ,Primary_Contact_Name
            ,Primary_Contact_Title
            ,Primary_Contact_Phone
            ,Secondary_Contact_Name
            ,Secondary_Contact_Title
            ,Secondary_Contact_Phone
            ,Tertiary_contact_Name
            ,Tertiary_Contact_Title
            ,Tertiary_Contact_Phone
            ,Bank_Id
            ,Bank_Account_Id
            ,Bank_Account_Type
            ,Bank_Account_Date
            ,EFT_Flag
            ,Fund_Limit
            ,Invoicable
            ,TaxCode
            ,Tax_Id
            ,Sales_Tax
            ,Service_Charge
            ,Instant_Cashing_Type
            ,Instant_Telsel_Rep
            ,Instant_Number_of_Bins
            ,Instant_Number_Itvms
            ,InstantCredit_Limit
            ,Auto_Reorder
            ,Instant_Terminal_Reorder
            ,Instant_Telsel_Reorder
            ,Instant_Teleset_Active_CDC
            ,Instant_Initial_Distribution
            ,Auto_Telsel_Schedule
            ,Instant_Auto_Settle
            ,Instant_Call_Day
            ,Instant_Call_Week
            ,Instant_Call_Cycle
            ,Instant_Order_Restriction
            ,Instant_Delivery_Flag
            ,Instant_Account_Type
            ,Instant_Settle_Class
            ,Region
            ,County
            ,Territory_x
            ,Route
            ,Chain_Statement
            ,Master_Agent_Id
            ,Minority_Owned
            ,Tax_Name
            ,State_Tax_Id
            ,Mailing_Name
            ,Bank_Account_Name
            ,DSR
          )
        )
        LOCATION ('test.txt')
      )
      PARALLEL
     REJECT LIMIT UNLIMITED
    /
    
    SQL> select * from agent_dump_csv_temp
      2  /
    
      AGENT_ID AGENT_TYPE CREATE_DATE TERMINATION_CDC ACTIVATION_CDC DEACTIVATION_CDC  AGENT_IDX AGENT_STATUS STATUS_DATE STATUS_REASON_CODE UPDATE_CDC UPDATE_SERIAL UPDATE_USER NEW_OWNER_AGENT_ID PREVIOUS_OWNER_AGENT_ID
    ---------- ---------- ----------- --------------- -------------- ---------------- ---------- ------------ ----------- ------------------ ---------- ------------- ----------- ------------------ -----------------------
    AGENT_NAME                                         PRIMARY_ADDRESS1                                   PRIMARY_ADDRESS2                                   PRIMARY_ADDRESS3
    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- --------------------------------------------------
    SECONDARY_ADDRESS1                                 SECONDARY_ADDRESS2                                 SECONDARY_ADDRESS3                                 PRIMARY_CITY
    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- --------------------------------------------------
    PRIMARY_STATE                                      PRIMARY_ZIP                                        PRIMARY_ZIP_SUFFIX                                 PRIMARY_COUNTRY
    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- --------------------------------------------------
    SECONDARY_CITY                                     SECONDARY_STATE                                    SECONDARY_ZIP                                      SECONDARY_ZIP_SUFFIX
    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- --------------------------------------------------
    SECONDARY_COUNTRY                                  PHONE_NUMBER                                       FAX_NUMBER                                         MOBILE_NUMBER                                      BUSINESS_TYPE  FIELD_REP BILL_TO_CHAIN_ID
    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ------------- ---------- ----------------
    MON_O MON_C TUE_O TUE_C WED_O WED_C THU_O THU_C FRI_O FRI_C SAT_O SAT_C SUN_O SUN_C    ZONE_ID LINE_CHARGE_CLASS   CHAIN_ID CHAIN_CODE PRIMARY_CONTACT_NAME                               PRIMARY_CONTACT_TITLE
    ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ---------- ----------------- ---------- ---------- -------------------------------------------------- --------------------------------------------------
    PRIMARY_CONTACT_PHONE                              SECONDARY_CONTACT_NAME                             SECONDARY_CONTACT_TITLE                            SECONDARY_CONTACT_PHONE
    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- --------------------------------------------------
    TERTIARY_CONTACT_NAME                              TERTIARY_CONTACT_TITLE                             TERTIARY_CONTACT_PHONE                                BANK_ID BANK_ACCOUNT_ID BANK_ACCOUNT_TYPE BANK_ACCOUNT_DATE   EFT_FLAG FUND_LIMIT INVOICABLE
    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------- --------------- ----------------- ----------------- ---------- ---------- ----------
       TAXCODE     TAX_ID  SALES_TAX SERVICE_CHARGE INSTANT_CASHING_TYPE INSTANT_TELSEL_REP INSTANT_NUMBER_OF_BINS INSTANT_NUMBER_ITVMS INSTANTCREDIT_LIMIT AUTO_REORDER INSTANT_TERMINAL_REORDER INSTANT_TELSEL_REORDER INSTANT_TELESET_ACTIVE_CDC
    ---------- ---------- ---------- -------------- -------------------- ------------------ ---------------------- -------------------- ------------------- ------------ ------------------------ ---------------------- --------------------------
    INSTANT_INITIAL_DISTRIBUTION AUTO_TELSEL_SCHEDULE INSTANT_AUTO_SETTLE INSTANT_CALL_DAY INSTANT_CALL_WEEK INSTANT_CALL_CYCLE INSTANT_ORDER_RESTRICTION INSTANT_DELIVERY_FLAG INSTANT_ACCOUNT_TYPE INSTANT_SETTLE_CLASS     REGION     COUNTY TERRITORY_X
    ---------------------------- -------------------- ------------------- ---------------- ----------------- ------------------ ------------------------- --------------------- -------------------- -------------------- ---------- ---------- -----------
         ROUTE CHAIN_STATEMENT MASTER_AGENT_ID MINORITY_OWNED TAX_NAME                                        STATE_TAX_ID MAILING_NAME                                          BANK_ACCOUNT_NAME                                 DSR
    ---------- --------------- --------------- -------------- -------------------------------------------------- ------------ -------------------------------------------------- -------------------------------------------------- ----------
             0          1           0               0              0                0          0            1       0                      0        302             0           0                  0                       0
    
                                                                                                                                                                                                                    0          0                0
                                                                                                 0                 0          0
    
                                                                                                                                                                                                0        -2.146E+09          0          0          0
             0                     0              0                    0                  0                      0                    0                   0            0                        0                      0                          0
                               0                    0                   0                1                 0          0                         0                     0                    0                    0          0          0           0
                             0               0              0
    
             1          1  1256213087               0         -39081           -39081          1            2  1256213087                999        302             0           0                  0                       0
    Pseudo Outlet
    
    MU                                                                                                                                               MU
                                                       MU
    MU                                                                                                                                                                                                       0         0                1
    06:00 23:59 06:00 23:59 06:00 23:59 06:00 23:59 06:00 23:59 06:00 23:59 06:00 23:59          0              0     0
    
                                                                                                                                                                                                1        -2.146E+09          1          0          1
             0                     0              0                    0                  0                      0                    0                   0            0                        0                      0                      -3287
                               0                    0                   0                1                 1          2                         0                     0                    0                    1          0        999           0
                             5               0              0
    
    SQL>
    

    He dislikes the identifier 'territory', so I renamed it to "territory_x" (I guess that's a reserved word).
    Your initial problem you had was your fields "SEPARATED"... instead of "TERMINATED" by. ;)

  • How to load xml using sql loader data?

    Is there any load script of XML data in a table through sql loader?

    Help me out here...

    Thank you

    You can post your code here? while I can help you... your code format should be like this...

    Example code:

    DOWNLOAD THE DATA

    INFILE *.

    IN THE TABLE po_tab

    ADD

    XMLTYPE (xmldata)

    FIELDS

    (xmldata TANK (2000))

    BEGINDATA

    "" http://www.Oracle.com/po/"xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"

    "" xsi: schemaLocation = "http://www.oracle.com/PO http://www.oracle.com/scha0/po1.xsd"

    orderDate = "1999-10-20" >

    Alice Smith

    123 maple Street

    Mill Valley

    CA

    90952

    Robert Smith

    8 oak Avenue

    Old town

    PA

    95819

    Hurry, my lawn is going wild!

    Lawn mower

    1

    148.95

    Confirm this is electric

    Baby monitor

    1

    39.98

    1999-05-21

Maybe you are looking for