SQL Loader mystery

Would appreciate any help. 10.2.0.4 standard Edition on Windows 2003 64-bit.

My definition of the table is:
create table cfive (keywords varchar2(4000));
My SQL Loader Control file is:
LOAD DATA 
INFILE 'C:\Documents and Settings\Administrator.HORAE\Desktop\testdata.txt' 
APPEND 
INTO TABLE import.cfive 
FIELDS TERMINATED BY ',' 
OPTIONALLY ENCLOSED BY '"' 
TRAILING NULLCOLS 
(KEYWORDS)
And my data are:

'active wear, young, ballerina, ballerina, ballet, ballerinas, Pointe Shoes,
Body, clothes, clothing dance, dancer, sweet, graceful, dance, education, shoes,
inside, instruction, isolation, Leotard, tutu, pensive, people, performance, skill, solitude,.
women, the preparation, the tying, studio shot.

(I broke which on several lines here, but in reality, it's a whole long line of text).

I invoke sqlloader as follows:
sqlldr import/xxxxxxx control=testctl.txt log=testlog3.txt bad=testbad3.txt
The program ends, but generates a log file that includes this:
Control File:   testctl.txt
Data File:      C:\Documents and Settings\Administrator.HORAE\Desktop\testdata.txt
  Bad File:     testbad3.txt
  Discard File:  none specified
 
 (Allow all discards)

Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array:     64 rows, maximum of 256000 bytes
Continuation:    none specified
Path used:      Conventional

Table IMPORT.CFIVE, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effect

   Column Name                  Position   Len  Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
KEYWORDS                            FIRST     *   ,  O(") CHARACTER            

Record 1: Rejected - Error on table IMPORT.CFIVE, column KEYWORDS.
Field in data file exceeds maximum length

Table IMPORT.CFIVE:
  0 Rows successfully loaded.
  1 Row not loaded due to data errors.
  0 Rows not loaded because all WHEN clauses were failed.
  0 Rows not loaded because all fields were null.
.. .and my line of data is not loaded. The log file says that keywords data of excessive length, but is of course not: the table allows 4000 characters, actual data are only 286 characters long.

The database using WE8ISO8859P1 character set, bytes and characters should be equivalent to this opportunity.

I'm looking for indications as to why it does not work! Thank you in advance.

Try to specify the maximum length of the data entry in SQL * Loader control file:

LOAD DATA
INFILE 'testdata.txt'
INTO TABLE cfive
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
(keywords char(4000))
{code}

with testdata.txt on 1 line:
{code}
"active wear,young,ballerina,ballet dancer,ballet dancing,ballet slippers,pointe shoes,soft,bodysuit,clothing,dance wear,dancer,graceful,dancing,educated,female,footwear,indoors,instruction,isolation,leotard,tutu,pensive,people,performing,skill,solitude,women,preparing,tying,studio shot"
{code}

I get:
{code}
type testdata.log

SQL*Loader: Release 10.2.0.1.0 - Production on Fri Oct 2 09:40:33 2009

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

Control File:   testdata.ctl
Data File:      testdata.txt
  Bad File:     testdata.bad
  Discard File:  none specified

 (Allow all discards)

Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array:     64 rows, maximum of 256000 bytes
Continuation:    none specified
Path used:      Conventional

Table CFIVE, loaded from every logical record.
Insert option in effect for this table: INSERT

   Column Name                  Position   Len  Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
KEYWORDS                            FIRST  4000   ,  O(") CHARACTER

value used for ROWS parameter changed from 64 to 63

Table CFIVE:
  1 Row successfully loaded.
  0 Rows not loaded due to data errors.
  0 Rows not loaded because all WHEN clauses were failed.
  0 Rows not loaded because all fields were null.

Space allocated for bind array:                 252126 bytes(63 rows)
Read   buffer bytes: 1048576

Total logical records skipped:          0
Total logical records read:             1
Total logical records rejected:         0
Total logical records discarded:        0

Run began on Fri Oct 02 09:40:33 2009
Run ended on Fri Oct 02 09:40:33 2009

Elapsed time was:     00:00:00.08
CPU time was:         00:00:00.03

and

SQL> select length(keywords) from cfive;

LENGTH(KEYWORDS)
----------------
             286

I use the customer of Oracle 10.2.0.1 database and Oracle 10.2.0.4 EE database.

Tags: Database

Similar Questions

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

  • SQL Loader failed

    Hi all

    I am load flat file in custom intermediate table using sql loader, but I'm betting that the error

    Record 2720: Rejected - error on the table XXPLL_SALES_FCST_BGA_TMPL, column MKTG_ASP.

    ORA-01722: invalid number

    XXPLL_SALES_FCST_BGA_TMPL - Custom intermediate Table


    MKTG_ASP - contains decimal values


    I created this column as a number data type.


    I've seen much after and it was proposed to use 'Decimal external' but it still does not work. All suggestions will be useful.



    Thank you

    Sharath Chander M



    Hi Barbara Boehmer

    Now, I changed in the file ctl under 'EXTERNAL DECIMAL Mktg_ASP DONE BY a SPACE' and now all data are allowed in / load. Is - this way?

    I will also try as you say. Also if the data file has a line any, as a null value for this column will be it's causing any problem for the amendment that I have performed in ctl file?

    Thank you

    Sharath Chander M

  • SQL Loader - ignore the lines with "rejected - all null columns."

    Hello

    Please see the attached log file. Also joined the table creation script, data file and the bad and throw the files after execution.

    Sqlldr customer in the version of Windows-

    SQL * Loader: release 11.2.0.1.0 - Production

    The CTL file has two clauses INTO TABLE due to the nature of the data. The data presented are a subset of data in the real world file. We are only interested in the lines with the word "Index" in the first column.

    The problem we need to do face is, according to paragraph INTO TABLE appears first in the corresponding CTL lines file to the WHEN CLAUSE it would insert and the rest get discarded.

    1. statement of Create table : create table dummy_load (varchar2 (30) name, number, date of effdate);

    2. data file to simulate this issue contains the lines below 10. Save this as name.dat. The intention is to load all of the rows in a CTL file. The actual file would have additional lines before and after these lines that can be discarded.

    H15T1Y Index | 2. 19/01/2016 |

    H15T2Y Index | 2. 19/01/2016 |

    H15T3Y Index | 2. 19/01/2016 |

    H15T5Y Index | 2. 19/01/2016 |

    H15T7Y Index | 2. 19/01/2016 |

    H15T10Y Index | 2. 19/01/2016 |

    CPDR9AAC Index | 2. 15/01/2016 |

    MOODCAVG Index | 2. 15/01/2016 |

    H15TXXX Index | 2. 15/01/2016 |

    H15TXXX Index | 2. 15/01/2016 |

    3. the CTL file - name.ctl

    DOWNLOAD THE DATA

    ADD

    IN THE TABLE dummy_load

    WHEN (09:13) = "Index".

    TRAILING NULLCOLS

    (

    COMPLETED name BY ' | ',.

    rate TERMINATED BY ' | '.

    COMPLETED effdate BY ' | '. ' TO_DATE (: effdate, "MM/DD/YYYY").

    )

    IN THE TABLE dummy_load

    WHEN (08:12) = "Index".

    TRAILING NULLCOLS

    (

    COMPLETED name BY ' | ',.

    rate TERMINATED BY ' | '.

    COMPLETED effdate BY ' | '. ' TO_DATE (: effdate, "MM/DD/YYYY").

    )

    invoke SQL loader in a file-> beats

    C:\Oracle\product\11.2.0\client\bin\sqlldr USERID = myid/[email protected] CONTROL=C:\temp\t\name.ctl BAD=C:\temp\t\name_bad.dat LOG=C:\temp\t\name_log.dat DISCARD=C:\temp\t\name_disc.dat DATA=C:\temp\t\name.dat

    Once this is run, the following text appears in the log file (excerpt):

    Table DUMMY_LOAD, charged when 09:13 = 0X496e646578 ('Index' character)

    Insert the option in effect for this table: APPEND

    TRAILING NULLCOLS option in effect

    Column Position Len term Encl. Datatype name

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

    NAME                                FIRST     *   |       CHARACTER

    RATE                                 NEXT     *   |       CHARACTER

    EFFDATE NEXT * |       CHARACTER

    SQL string for the column: ' TO_DATE (: effdate, "MM/DD/YYYY").

    Table DUMMY_LOAD, charged when 08:12 = 0X496e646578 ('Index' character)

    Insert the option in effect for this table: APPEND

    TRAILING NULLCOLS option in effect

    Column Position Len term Encl. Datatype name

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

    NAME                                 NEXT     *   |       CHARACTER

    RATE                                 NEXT     *   |       CHARACTER

    EFFDATE NEXT * |       CHARACTER

    SQL string for the column: ' TO_DATE (: effdate, "MM/DD/YYYY").

    Record 1: Ignored - all null columns.

    Sheet 2: Cast - all null columns.

    Record 3: Ignored - all null columns.

    Record 4: Ignored - all null columns.

    Sheet 5: Cast - all null columns.

    Sheet 7: Discarded - failed all WHEN clauses.

    Sheet 8: Discarded - failed all WHEN clauses.

    File 9: Discarded - failed all WHEN clauses.

    Case 10: Discarded - failed all WHEN clauses.

    Table DUMMY_LOAD:

    1 row loaded successfully.

    0 rows not loaded due to data errors.

    9 lines not loading because all WHEN clauses were failed.

    0 rows not populated because all fields are null.

    Table DUMMY_LOAD:

    0 rows successfully loaded.

    0 rows not loaded due to data errors.

    5 rows not loading because all WHEN clauses were failed.

    5 rows not populated because all fields are null.


    The bad file is empty. The discard file has the following

    H15T1Y Index | 2. 19/01/2016 |

    H15T2Y Index | 2. 19/01/2016 |

    H15T3Y Index | 2. 19/01/2016 |

    H15T5Y Index | 2. 19/01/2016 |

    H15T7Y Index | 2. 19/01/2016 |

    CPDR9AAC Index | 2. 15/01/2016 |

    MOODCAVG Index | 2. 15/01/2016 |

    H15TXXX Index | 2. 15/01/2016 |

    H15TXXX Index | 2. 15/01/2016 |


    Based on the understanding of the instructions in the CTL file, ideally the first 6 rows will have been inserted into the table. Instead the table comes from the line 6' th.

    NAMERATEEFFDATE
    H15T10Y Index2January 19, 2016



    If the INTO TABLE clauses were put in the CTL file, then the first 5 rows are inserted and the rest are in the discard file. The line 6' th would have a ""rejected - all columns null. "in the log file. "


    Could someone please take a look and advise? My apologies that the files cannot be attached.

    Unless you tell it otherwise, SQL * Loader assumes that each later in the table and what clause after the first back in the position where the previous left off.  If you want to start at the beginning of the line every time, then you need to reset the position using position (1) with the first column, as shown below.  Position on the first using is optional.

    DOWNLOAD THE DATA

    ADD

    IN THE TABLE dummy_load

    WHEN (09:13) = "Index".

    TRAILING NULLCOLS

    (

    name POSITION (1) TERMINATED BY ' | '.

    rate TERMINATED BY ' | '.

    COMPLETED effdate BY ' | '. ' TO_DATE (: effdate, "MM/DD/YYYY").

    )

    IN THE TABLE dummy_load

    WHEN (08:12) = "Index".

    TRAILING NULLCOLS

    (

    name POSITION (1) TERMINATED BY ' | '.

    rate TERMINATED BY ' | '.

    COMPLETED effdate BY ' | '. ' TO_DATE (: effdate, "MM/DD/YYYY").

    )

  • Condition of licence for SQL Loader?

    Hello

    I have an installing the oracle client that allows me to use SQLPLUS to connect to our Oracle 11g databases. SQL Loader is optional for installation. I would like to make use of this utility. Can anyone confirm if there is a condition of additional license to install SQL Loader?

    TIA

    Oracle allows the tools that usually used to interact with the database. SQL * Plus, SQL Developer, SQL * Loader are all free. If you use a feature optionally licensed in the database that makes the difference. For example, Oracle Partitioning is an extra cost feature. You can use SQL * Loader to load data into an Oracle database without that it costs you nothing more. But if you use SQL * Loader to load into a partitioned table, you will have to pay for the partitioning, but not SQL * Loader.

    See you soon,.
    Brian

  • SQL loader question

    Hi people,

    Please find the table with the records below

    CREATE TABLE EMPLOYEE_LOAD (ID NUMBER, NAME VARCHAR2 (100), UNIVERSITY_NAME VARCHAR2 (100));

    File to load: employee.txt

    ID | NAME | UNIVERSITY_NAME

    1. JAMES | UNIVERSITY OF MIT

    2. LISA | UNIVERSITY OF CAMBRIDGE

    3. MINDY | "THIS UNIVERSITY

    4. ' ALLEN J |' IT UNIVERSITY

    5. ' MIKE'ALLEN | "THIS UNIVERSITY

    I've written SQL Loader control as file below

    OPTIONS(SKIP=1,DIRECT=TRUE)

    DOWNLOAD THE DATA

    INFILE ' mnt/employee.txt.

    BADFILE "mnt/employee.bad.

    DISCARDFILE ' mnt/employee.dsc.

    ADD THE EMPLOYEE_LOAD TABLE

    FIELDS TERMINATED BY ' | '. SURROUNDED OF POSSIBLY ' ' ' TRAILING NULLCOLS

    (

    ID,

    NAME,

    UNIVERSITY_NAME

    )

    sqlldr userid = < username > @database/password control=/mnt/employee.ctl log=/mnt/employee.log

    Only 2 first recordings are loading (excluding the header) and face below errors

    (1) no terminator found after CLOSE and CLOSED field

    (2) second string for the attachment does not exist

    These 3 recordings are in the wrong files and how do I force sql loader to load subfolders too?

    3. MINDY | "THIS UNIVERSITY

    4. ' ALLEN J |' IT UNIVERSITY

    5. ' MIKE'ALLEN | "THIS UNIVERSITY

    Try to remove the ENCLOSED BY ' ' ' clause.  It is not true, according to your sample data.

    These quotes seem to be interspersed randomly.

  • On the use of SQL * loader program pl/sql command

    Is it possible to develop a PL/SQL program that calls SQL * Loader (sqlldr userid =...) command?

    We want to package a process that loads data from a text file into a table, and we research it is possible to use SQL * Loader to the data loading process.

    You can launch sqlldr like all other orders of operation. There are several methods of cooking OS command, as

    1. external procedure PL/SQL: CHMOD FROM A PLSQL?

    Johan's blog: how to call PL/SQL kernel32.dll.

    2 Java Stored Procedure: Blog of Johan: using JAVA in PL/SQL - PART - I list files with timestamp , Blog of Johan: using JAVA in PL/SQL - PART - II operating system information obtaining

    3. external PREPROCESSOR Table function: no response on java not call windows in oracle command

    Johan's blog: list uses of disk operating system with external feature of the Oracle PREPROCESSOR Table

    Johan's blog: operating system from the list of files with external feature of the Oracle PREPROCESSOR Table

    4. using DBMS_SCHEDULER,job_type => 'executable' and job_action  => '/bin/sh' (may be)

  • 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 - null is not recognized

    Hi, I have a very strange question that I would really appreciate help with.

    We have the file following sql ctl charger that works very well.

    OPTIONS (DIRECT = TRUE, PARALLEL = FALSE, ERRORS = 0, BINDSIZE = 50000, LINES = 10000, READ)

    SIZE = 65536)

    DOWNLOAD THE DATA

    CHARACTERSET WE8MSWIN1252

    INFILE 'file1' "STR X ' 0 and has.

    READBUFFERS 4

    IN THE TABLE test.tabl1

    TRUNCATE

    REACTIVATE THE DISABLED_CONSTRAINTS

    FIELDS

    (

    POSITION TANK (01:25) "DT_TM_ADDED" "DECODE (SUBSTR (: DT_TM_ADDED, 13.2), null,).

    Substr(:dt_tm_added,1,11) | "(00:00:00 ',: DT_TM_ADDED) ' etc. .

    We must now change our ctl files so the fields are completed by |

    It now looks like this.

    FIELDS TERMINATED BY ' |'

    (

    "DT_TM_ADDED" TANK "DECODE (SUBSTR (: DT_TM_ADDED, 13.2), null, substr(:dt_tm_add)).

    Ed, 1, 11). 00:00:00',TRIM(:DT_TM_ADDED)) ", etc.

    This works great besides when the DT_TM_ADDED, 13.2 has a value zero. Its not picking up that it is worth zero. If I change the statement as follows using a ' ' instead of null, IE (: DT_TM_ADDED, 13.2), ' ', substr,... it works very well.


    Am I missing something really obvious here?

    Any help would be really appreciated.

    Morgan Library has great demos on SQL LOADER.

    Demo 6

    "Use keywords NULLIF and DRAFTS to manage a length no strings loaded into numeric columns. Also note the use of the Direct path load in the control file (DIRECT = TRUE). »

    Link: Oracle 12 c SQL * Loader

    It could be that useful...

  • SQL Loader when Clause

    Hello

    I have a requirement to load a file and exclude lines on a column with a value where ID NOT LIKE ' % no data %'

    OPTIONS (SKIP = 3)

    DOWNLOAD THE DATA

    INFILE ' / home/test.csv '

    IN THE test TABLE

    TRUNCATE

    What ID do NOT LIKE ' % no data %'

    ' Surrounded FIELDS TERMINATED BY ',' possibly ' ' '

    TRAILING NULLCOLS

    (ID,

    BEGUN,

    TIME,

    DATE_ADDED SYSDATE

    )

    Some examples of ID:

    Data AVDFGHKL:no

    Data THGEIUJD:no

    The value will always point 10 a go (after the semi colon)

    I tried the following, but not luck

    When (1) = '1') AND (10:2). = 'No '.

    Yes, the outer table can be a better option (the file must be in the server). Depending on your data (i.e. the colon (:)) always comes in 9th place) it will work.)

    [oracle@localhost saubhik]$ cat my_data.txt
    AVDFGHKL:No Data, 09/11/2009
    JFDJFUJK, 09/11/2009
    AGHFJDKK:No Data, 09/11/2009
    TRUTIRUT, 09/11/2009
    [oracle@localhost saubhik]$ 
    
    [oracle@localhost saubhik]$ cat test_emp_ctl.ctl
    LOAD DATA
    INFILE 'my_data.txt'
    INTO TABLE test
    TRUNCATE
    when (9:9) <> ":"
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    (id, start_date DATE(19) "DD-MM-YYYY")
    [oracle@localhost saubhik]$ sqlldr scott/tiger control=test_emp_ctl.ctl
    
    SQL*Loader: Release 11.2.0.1.0 - Production on Tue Jun 2 16:20:22 2015
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Commit point reached - logical record count 4
    [oracle@localhost saubhik]$ 
    

    Audit:

    SQL> SELECT * FROM test;
    
    ID                             START_DAT
    ------------------------------ ---------
    JFDJFUJK                       09-NOV-09
    TRUTIRUT                       09-NOV-09
    
    SQL> 
    
  • SQL loader is loading only one record

    I use SQL loader to load a CSV file into database

    sqlldr CON CONTROL = 'test.ctl' = 'TEST.log' = bad "bad.bad" LOG DATA = ' test. DAT'

    How ever I always only one record

    CTL file

    OPTIONS (ERRORS = 50)

    DOWNLOAD THE DATA

    ADD

    CONTINUEIF NEXT(1:1) = ' # '.

    IN TABLEtest

    FIELDS TERMINATED BY' '

    SURROUNDED OF POSSIBLY ' "" ' AND ' "'"

    TRAILING NULLCOLS)

    "Etest_ID" (27) TANK.

    'test_IND' CHAR (8),

    'test_SUB_IND' CHAR (12),

    "test_GIND1" TANK (9).

    "test_GIND2" TANK (9).

    'test_STATUS' CHAR (11),

    'test_STATUS' CHAR (11),

    'test_AMOUNT1' CHAR (14).

    'test_AMOUNT2' CHAR (14).

    'test_AMOUNT3' CHAR (14).

    'test_AMOUNT4' CHAR (14).

    "test_GIND21" TANK (9).

    "tet_GIND3" TANK (9).

    'test_STATUS1' CHAR (11),

    'test_STATUS2' CHAR (11),

    'test_AMOUNT1' CHAR (14).

    'test_AMOUNT2' CHAR (14).

    "test_FLAG" TANK (9).

    'test_USED_FLAG' CHAR (15).

    "test_FLAG" TANK (9).

    'TtestL_TRF_AMOUNT' CHAR (16).

    'testF_DATE' CHAR (8),

    'test_STATUS' CHAR (14))

    data file

    'AB00431MT00377_110915_00000 '."PP"."    "« Y »« Y »'TRAN '."FAILURE."'00000008667.15 '.'00000000000.00 '.'00000000000.00 '.'00000000000.00 '.« Y »« Y »'ZERO '.'ZERO '.'00000000000.00 '.'00000000000.00 '.« Y »« Y »" "'00000008667.15 '.'2111014 '.« S »
    'AB00431MT00377_110915_00000 '."PP"."    "« Y »" "'ZERO '."    "'00000000000.00 '.'00000000000.00 '.'00000000000.00 '.'00000000000.00 '.« Y »" "'ZERO '."    "'00000000000.00 '.'00000000000.00 '.« Y »" "" "'00000000000.00 '."0000000".« R »

    Help, please

    I tried generating CTL gall in various Noah this option worked. It is urgent please help

  • Name of dynamic INFILE SQL loader

    Hi all

    I use oracle 10g on windows server.

    I have a log on a remote server. each line in the log file is as below

    LogIN Mar 02/09/2014 10:10:48 ss18 N419FS40 1

    I create a table for that as below;

    Create table free_pc (log_in varchar2(10),log_day varchar2(10),log_date date,log_time date,log_user varchar2(30),log_Lab varchar2(30),log_pc varchar2(30), log_status char(1));
    

    I have two problems;

    1 N419FS40, the N419 is the name of a student in the lab, while FS40 is the name of the computer in this laboratory. I want only the first four characters to be inserted into the column of Log_lab and the rest of characters iin Log_pc column. my control file is less than

    DOWNLOAD THE DATA

    INFILE '\\remote_location\login02_09_14.txt '.

    ADD

    IN THE TABLE free_pc

    FIELDS FINISHED WITH A WHITE SPACE

    (log_in,

    log_day,

    log_date DATE "DD/MM/YYYY",

    log_time DATE "HH24 MI SS."

    LOG_USER,

    log_Lab,

    log_PC,

    log_status

    )

    How to do this?

    2. the log file is generated on the server, every day with a different name, he cancatenate the current date with Word LOGIN, for example login02_09_14.txt, login03_09_14.txt and login04_09_14 etc. in my INFILE tag, how can I put the name, so that it automatically take the name of the remote location?

    Thank you.

    Kind regards.

    1. you can use the SUBSTR function to separate the two values.  You put the fields in the control file in the same order in the data file, with all the columns that are formulated from data in other areas at the end.

    2. There are different ways to do this.  The file name can be in the control file or the SQL * Loader command line.  You can create either using SQL/SQL * Plus or operating system commands.  I tend to prefer change just the line of SQL * Loader command line, instead of the entire control file.  I prefer to do this in a SQL file instead of a file breaks Windows or * ix shell script or something, so that it is independent of the operating system.

    In addition, it is best to store all of your day, date and time in a column, then you can use to_char to display it as you want, in a column, or two or three.

    Please see the example below, in which I have shown above.

    Scott@ORCL >-data file you provided with the name changed to include today's date:

    Scott@ORCL > HOST TYPE 'c:\remote_location\login27_04_15.txt '.

    Opening on Tuesday, September 2, 2014 ss18 N419FS40 1 10:10:48

    Scott@ORCL >-control file with no infile, fields in the order of the data file, using fill for the unused columns,.

    Scott@ORCL >-with forumulated columns, using boundfiller for filling necessary for columns columns drawn up:

    Scott@ORCL > test.ctl TYPE of HOST

    DOWNLOAD THE DATA

    ADD

    IN THE TABLE free_pc

    FIELDS FINISHED WITH A WHITE SPACE

    TRAILING NULLCOLS

    (log_in,

    log_day FILLING,

    log_date BOUNDFILLER,

    log_time BOUNDFILLER,

    LOG_USER,

    log_Lab ' SUBSTR (: log_lab, 1, 4). "

    log_status,

    log_date_time ' TO_DATE (: log_date |: log_time, "MM/DD / YYYYHH24:MI:SS'"). "

    log_PC ' SUBSTR (: log_lab, 5) ')

    Scott@ORCL >-sql script which now enables to get the data and it concatenates the file name with the path of the directory

    Scott@ORCL >- and loads the data running SQL * Loader of SQL * Plus, using the HOST command:

    Scott@ORCL > test.sql TYPE of HOST

    COLUMN data_file new_value data_file

    SELECT 'c:\remote_location\login ' | TO_CHAR (SYSDATE, 'DD_MM_YY'). ".txt" AS data_file FROM DUAL

    /

    HOST SQLLDR scott/tiger CONTROL = test.ctl DATA = '& data_file' LOG = test.log

    CLEAR COLUMN

    Scott@ORCL >-table which includes the date and time in a column, for the day of the week can be extracted:

    Scott@ORCL > create table free_pc

    2 (log_in varchar2 (10))

    3, date log_date_time

    4, log_user varchar2 (30)

    5, log_Lab varchar2 (30)

    6, log_pc varchar2 (30)

    7, log_status char (1))

    8.

    Table created.

    Scott@ORCL >-load data file sql running running SQL * Loader using the control file:

    Scott@ORCL > test.sql START

    Scott@ORCL > data_file new_value data_file COLUMN

    Scott@ORCL > SELECT 'c:\remote_location\login ' | TO_CHAR (SYSDATE, 'DD_MM_YY'). ".txt" AS data_file FROM DUAL

    2.

    DATA_FILE

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

    c:\remote_location\login27_04_15.txt

    1 selected line.

    Scott@ORCL > HOST SQLLDR scott/tiger CONTROL = test.ctl DATA = '& data_file' LOG = test.log

    SQL * Loader: release 11.2.0.1.0 - Production on my Apr 27 12:00:53 2015

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

    Commit the point reached - the number of logical records 1

    Scott@ORCL > CLEAR COLUMN

    Scott@ORCL >-results with Date_Time field displayed in the form of day, date and time:

    Scott@ORCL > log_in COLUMN FORMAT A6

    Scott@ORCL > log_day COLUMN FORMAT A7

    Scott@ORCL > log_user COLUMN FORMAT A8

    Scott@ORCL > log_lab COLUMN FORMAT A8

    Scott@ORCL > log_pc COLUMN FORMAT A6

    Scott@ORCL > log_status FORMAT A10 COLUMN

    Scott@ORCL > SELECT log_in,.

    2 TO_CHAR (log_date_time, ' HH24:MI:SS Dy DD-Mon-YYYY ') ' DAY DATE TIME. "

    3 log_user, log_lab, log_pc, log_status

    4 FROM free_pc

    5.

    LOG_IN DAY DATE TIME LOG_USER LOG_LAB LOG_PC LOG_STATUS

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

    LogIN Mar 02 - Sep - 2014 ss18 N419 FS40 1 10:10:48

    1 selected line.

  • 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

  • the formatting of char to number in sql loader control file

    I tried to load a huge csv Excel file into oracle with sql loader database. But a column contains numbers of year as '2014', ' 2015 ". In the control file, I have defined as:

    column_name decimal (38) external "TO_NUMBER (: column_name, ' 9999').

    It awlays say: ORA-01722 invalid number format. I changed the format of different number. All this has not worked. Please help me on this.

    1. the data of table column type is number (38.0)

    2. data csv file looks like this: color is the number of year.

    04/03/15, D_2-15, 10953562, 11116, 27144, 03/03/15,2015

    04/03/15, P_1-58, 1143088, 5262, 12994, 03/03/15,2015

    04/03/15, Q_1-31_Distinct_WWE, 7576633, 22352, 52975, 03/03/15,2015

    Thanks in advance.

    We can not help you unless you provide a sample of documents failed. The sample you provided loads without any problems:

    SQL > CREATE TABLE MY_TABLE)
    2 COLONNE_1 DATE,
    3 COLUMN_2 VARCHAR2 (255 BYTE).
    COLUMN_3 VARCHAR2 (255 BYTE) 4.
    COLUMN_4 VARCHAR2 (255 BYTE) 5.
    6 COLUMN_5 VARCHAR2 (255 BYTE).
    7 COLONNE_6 DATE,
    8 BUSINESS_YR NUMBER(*,0)
    9                      )
    10.

    Table created.

    SQL > home
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

    C:\app\xxx\product\11.2.0\dbhome_2\BIN>type c:\temp\xx.ctl
    DOWNLOAD THE DATA
    CHARACTERSET US7ASCII

    INFILE *.
    TRUNCATE
    IN THE TABLE MY_TABLE
    FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
    TRAILING NULLCOLS
    (
    COLONNE_1 DATE "MM-DD-AA.
    COLUMN_2 CHAR (255),
    COLUMN_3 CHAR (255),
    COLUMN_4 CHAR (255) NULLIF COLUMN_4 = BLANKS,
    COLUMN_5 CHAR (255) NULLIF COLUMN_5 = BLANKS,
    COLONNE_6 DATE "MM-DD-YY."
    BUSINESS_YR EXTERNAL INTEGER (38)
    )
    BEGINDATA
    03/20/15,1P-11,1111.22,,,03/22/15, 2014
    21/03/15, M_XXX-4, 5607817, 0, 0, 03-9/22/15, 2014
    22/03/15, M_DDD-2, 54990, 0, 0, 03-8/22/15, 2014
    23/03/15, R_1-46, 5297481, 24, 24, 03/22/15, 2014
    16/03/15, X_1 - 48 a, 8547274, 13474, 13474, 15/03/15, 2015
    03/17/15,1T-15-dental,2118.12,,,03/15/15, 2015
    18/03/15, 1 S - 1S, 555, 15/03/15, 2015
    19/03/15, P_NNN-7, 7455342, 10941, 10941, 03/15/15, 2015
    C:\app\xxx\product\11.2.0\dbhome_2\BIN>sqlldr control=c:\temp\xx.ctl log=c:\temp\xx.log
    Username:Scott
    Password:

    SQL * Loader: release 11.2.0.3.0 - Production on Sun Apr 5 06:28:06 2015

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

    Commit the point reached - the number of logical records 7
    Commit the point reached - the number of logical records 8

    C:\app\xxx\product\11.2.0\dbhome_2\BIN>exit

    SQL > column column_2 format a15
    SQL > column column_3 format a10
    SQL > column column_4 format a8
    SQL > column column_5 format a8
    SQL > select * from my_table
    2.

    COLUMN_1, COLUMN_2, COLUMN_3, COLUMN_4 COLUMN_5 COLONNE_6 BUSINESS_YR
    --------- --------------- ---------- -------- -------- --------- -----------
    MARCH 20, 15 1 P - 11 1111.22 2014 22 MARCH 15
    21 MARCH 15 M_XXX-9-4 5607817 0 0 22 MARCH 15 2014
    22 MARCH 15 M_DDD-8-2 54990 0 0 22 MARCH 15 2014
    23 MARCH 15 R_1-46 5297481 24 24 22 MARCH 15 2014
    16 March 15 X_1-48 has 8547274 13474 13474 15 March 15 2015
    March 17, 15 1 t 15-dental 2118.12 15 March 15 2015
    1 S - 1 S 18 MARCH 15 555 2015 15 MARCH 15
    MARCH 19, 15 P_NNN-7 7455342 10941 10941 15 MARCH 15 2015

    SY.

Maybe you are looking for