SQL*Loader load 2 tables

Does anyone know how load a field in 2 tables from a text file with sql loader.
I have 2 fields in my text file then i need to concatenate both fields and load in a field in the parent table and in the child table with the same value.
My data is:
Field1 Field2 Field3 Field4
01 cve1 valueA ValueB
My output that i want:
Table1
Field1 Field 2
01cve1 valueA
Table2
Field1 Field2
01cve1 valueB
I'm really desperate.
Oscar.

Hi,
You can use like the foll.
load data
infile..
bad ...
into table1
when recid =1
(recid
abc,
def)
into table2
when recid=2
(recid,
xyz)
Make sure the data file has recid at the start if each row.
Hope it helps!
Thanks
Rakesh

Similar Messages

  • Loading multiple tables with SQL Loader

    Hi,
    I want to load multiple tables from a single data file using SQL Loader.
    Here's the basic idea of what I want. Let's say I have two tables, table =T1
    and table T2:
    SQL> desc T1;
    COL1 VARCHAR2(20)
    COL2 VARCHAR2(20)
    SQL> desc T2;
    COL1 VARCHAR2(20)
    COL2 VARCHAR2(20)
    COL3 VARCHAR2(20)
    My data file, test.dat, looks like this:
    AAA|KBA
    BBR|BBCC|CCC
    NNN|BBBN|NNA
    I want to load the first record into T1, and the second and third record load into T2. How do I set up my control file to do that?
    Thank!

    Tough Job
    LOAD DATA
    truncate
    INTO table t1
    when col3 = 'dummy'
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS
    (col1,col2,col3 filler char nullif col3='dummy')
    INTO table t2
    when col3 != 'dummy'
    FIELDS TERMINATED BY '|'
    (col1,col2,col3 nullif col3='dummy')
    This will load t2 tbl but not t1.
    T1 Filler col3 is not accepting nullif. Its diff to compare columns have null using when condition. If i find something i will let you know.
    Can you seperate records into 2 file. Will a UNIX command work for you which will seperate 2col and 3col record types for you. and then you can execute 2 controlfiles on it.
    Thanks,
    http://www.askyogesh.com

  • SQL LOADER , EXTERNAL  TABLE and ODBS DATA SOURCE

    hello
    Can any body help loading data from dbase file .dbt to an oracle 10g table.
    I tried last day with SQL LOADER, EXTERNAL table , and ODBC data source.
    Why all of these utilities still failing to solve my problem ?
    Is there an efficient way to reach this goal ?
    Thanks in advance

    export the dbase data file to text file,
    then you have choice of using either sql loader or external table option to use.
    regards

  • Extract Data from XML and Load into table using SQL*Loader

    Hi All,
    We have a XML file (sample.xml) which contains credit card transaction information. We have a standard SQL*Loader control file which loads the data from a flat file and the control file code is written as position based method. Our requirement is to use this control file as per our requirement(i.e) load the data into the table from our XML file), But we need help in converting the XML to a flat file or Extract the data from the XML tags and pass the information to the control file and in turn it loads the table.
    Your suggestion is highly appreciated.
    Thanks in advance

    Hi,
    First of all go to PSA maintanance ( Where you will see PSA records ).
    Goto list---> Save-> File---> Spreadsheet (Choose Radio Button)
    > Give the proper file name where you want to download and then-----> Generate.
    You will get ur PSA data in Excel Format.
    Thanks
    Mayank

  • Load a table in a PL/SQL variable

    Hi!
    I'm using Oracle 8i and I'm interested in load a table from my database in a PL/SQL variable.In addition,I'm using Nested Table Type for loading a database table in a variable.When I load the table in the variable, I try doing a SQL query to the variable (is a nested table) but it doesn't work.There is some solution?
    In the following lines there is an example about what I'm trying:
    PACKAGE Types AS
    TYPE cursor_type IS REF CURSOR;
    END Types;
    CREATE TABLE EXAMPLE(
    ID NUMBER(4),
    VAL Number(3)
    CREATE or replace TYPE My_Row_Type AS OBJECT
    ID NUMBER(4),
    NStreet Number(3)
    CREATE OR REPLACE PACKAGE PROVA AS
    TYPE My_Tab_Type IS TABLE OF My_Row_Type;
    PROCEDURE GetEXAMPLE (p_recordset OUT types.cursor_type);
    END PROVA;
    CREATE OR REPLACE PACKAGE BODY PROVA AS
    PROCEDURE GetEXAMPLE (p_recordset OUT types.cursor_type) AS
    v_tab My_Tab_Type := My_Tab_Type();
    BEGIN
    FOR cur_row IN (SELECT * FROM EXAMPLE) LOOP
    v_tab.extend;
    v_tab(v_tab.Last) := My_Row_Type(cur_row.ID,     cur_row.NStreet);
    END LOOP;
    -- Open REF CURSOR for outout.
    OPEN p_recordset FOR
    SELECT *
    FROM Table(Cast(v_tab As My_Tab_Type));
    END GetEXAMPLE ;
    END PROVA;
    When I execute the procedure GetEXAMPLE, Oracle shows me the following error:
    ERROR en línea 1:
    ORA-00600: código de error interno, argumentos: [15419], [severe error during
    PL/SQL execution], [], [], [], [], [], []
    ORA-06544: PL/SQL: error interno, argumentos: [pfrrun.c:pfrbnd1()], [], [], [],
    ORA-06553: PLS-801: error interno [0]

    Create your My_Tab_Type as a SQL Object Type, instead of a PL/SQL Table Type:
    SQL> CREATE TABLE example
      2    (id     NUMBER (4),
      3       nstreet NUMBER (3))
      4  /
    Table created.
    SQL> INSERT INTO example VALUES (1234, 123)
      2  /
    1 row created.
    SQL> INSERT INTO example VALUES (2345, 234)
      2  /
    1 row created.
    SQL> COMMIT
      2  /
    Commit complete.
    SQL> CREATE OR REPLACE TYPE My_Row_Type AS OBJECT
      2    (id     NUMBER (4),
      3       nstreet NUMBER (3));
      4  /
    Type created.
    SQL> CREATE OR REPLACE TYPE My_Tab_Type AS TABLE OF My_Row_Type;
      2  /
    Type created.
    SQL> CREATE OR REPLACE PACKAGE types
      2  AS
      3    TYPE cursor_type IS REF CURSOR;
      4  END types;
      5  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE prova
      2  AS
      3    PROCEDURE GetExample
      4        (p_recordset OUT types.cursor_type);
      5  END prova;
      6  /
    Package created.
    SQL> SHOW ERRORS
    No errors.
    SQL> CREATE OR REPLACE PACKAGE BODY prova
      2  AS
      3    PROCEDURE GetExample
      4        (p_recordset OUT types.cursor_type)
      5    AS
      6        v_tab My_Tab_Type := My_Tab_Type();
      7    BEGIN
      8        FOR cur_row IN (SELECT * FROM example) LOOP
      9          v_tab.EXTEND;
    10          v_tab(v_tab.LAST) := My_Row_Type(cur_row.id, cur_row.nstreet);
    11        END LOOP;
    12        -- Open REF CURSOR for output.
    13        OPEN p_recordset FOR
    14        SELECT *
    15        FROM TABLE(CAST(v_tab AS My_Tab_Type));
    16    END GetExample;
    17  END prova;
    18  /
    Package body created.
    SQL> SHOW ERRORS
    No errors.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC prova.GetExample (:g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
            ID    NSTREET                                                          
          1234        123                                                          
          2345        234                                                          
    2 rows selected.

  • Populating a load-status table from SQL*Loader

    Hello,
    I am using SQL*LDR to load a table and once I'm done with this load I am supposed to populate a status table which will capture the 'SYSDATE', and the total number of rows I loaded in the other table.
    Can anybody help me?
    Thanks

    BTW, the load-status table would take the error-record-count as well as the load-count?
    Sorry missed that earlier!

  • SQL Loader : Loading multiple tables using same ctl file

    Hi ,
    We tried loading multiple tables using the same ctl file but the data was not loaded and no errors were thrown.
    The ctl file content is summarised below :
    LOAD DATA
    APPEND INTO TABLE TABLE_ONE
    when record_type ='EVENT'
    TRAILING NULLCOLS
    record_type char TERMINATED BY ',' ,
    EVENT_SOURCE_FIELD CHAR TERMINATED BY ',' ENCLOSED BY '"',
    EVENT_DATE DATE "YYYY-MM-DD HH24:MI:SS" TERMINATED BY ',' ENCLOSED BY '"',
    EVENT_COST INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
    EVENT_ATTRIB_1 CHAR TERMINATED BY ',' ENCLOSED BY '"',
    VAT_STATUS INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
    ACCOUNT_REFERENCE CONSTANT 'XXX',
    bill_date "to_date('02-'||to_char(sysdate,'mm-yyyy'),'dd-mm-yyyy')",
    data_date "trunc(sysdate)",
    load_date_time "sysdate"
    INTO TABLE TABLE_TWO
    when record_type ='BILLSUMMARYRECORD'
    TRAILING NULLCOLS
    RECORD_TYPE char TERMINATED BY ',' ,
    NET_TOTAL INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
    LOAD_DATE_TIME "sysdate"
    INTO TABLE BILL_BKP_ADJUSTMENTS
    when record_type ='ADJUSTMENTS'
    TRAILING NULLCOLS
    RECORD_TYPE char TERMINATED BY ',' ,
    ADJUSTMENT_NAME CHAR TERMINATED BY ',' ENCLOSED BY '"',
    LOAD_DATE_TIME "sysdate"
    INTO TABLE BILL_BKP_CUSTOMERRECORD
    when record_type ='CUSTOMERRECORD'
    TRAILING NULLCOLS
    RECORD_TYPE char TERMINATED BY ',' ,
    GENEVA_CUSTOMER_REF CHAR TERMINATED BY ',' ENCLOSED BY '"',
    LOAD_DATE_TIME "sysdate"
    INTO TABLE TABLE_THREE
    when record_type ='PRODUCTCHARGE'
    TRAILING NULLCOLS
    RECORD_TYPE char TERMINATED BY ',' ,
    PROD_ATTRIB_1_CHRG_DESC CHAR TERMINATED BY ',' ENCLOSED BY '"',
    LOAD_DATE_TIME "sysdate"
    Has anyone faced similar errors or are we going wrong somewhere ?
    Regards,
    Sandipan

    This is the info on the discard in the log file :
    Record 1: Discarded - failed all WHEN clauses.
    Record 638864: Discarded - failed all WHEN clauses.
    While some of the records were loaded for one table.
    Regards,
    Sandipan

  • SQL Loader to Load Multiple Tables from Multiple Files

    Hi
    I wish to create a control file to load multiple tables from multiple files
    viz.Emp.dat into emp table and Dept.dat into Dept table and so on
    How could I do it?
    Can I create a control file like this:
    OPTIONS(DIRECT=TRUE,
    SKIP_UNUSABLE_INDEXES=TRUE,
    SKIP_INDEX_MAINTENANCE=TRUE)
    UNRECOVERABLE
    LOAD DATA
    INFILE 'EMP.dat'
    INFILE 'DEPT.dat'
    INTO TABLE emp TRUNCATE
    FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"'
    (empno,
    ename,
    deptno)
    INTO TABLE dept TRUNCATE
    FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"'
    (deptno,
    dname,
    dloc)
    Appreciate a Quick Reply
    mailto:[email protected]

    Which operating system? ("Command Prompt" sounds like Windows)
    UNIX/Linux: a shell script with multiple calls to sqlldr run in the background with "&" (and possibly nohup)
    Windows: A batch file using "start" to launch multiple copies of sqlldr.
    http://www.pctools.com/forum/showthread.php?42285-background-a-process-in-batch-%28W2K%29
    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true
    Edited by: Brian Bontrager on May 31, 2013 4:04 PM

  • SQL Loader loads duplicate records even when there is PK defined

    Hi,
    I have created table with pk on one of the column.Loaded the table using sql loader.the flat file has duplicate record.It loaded all the records without any error but now the index became unusable.
    The requirement is to fail the process if there are any duplicate.Please help me in understaing why this is happening.
    Below is the ctl file
    OPTIONS(DIRECT=TRUE, ERRORS=0)
    UNRECOVERABLE
    load data
    infile 'test.txt'
    into table abcdedfg
    replace
    fields terminated by ',' optionally enclosed by '"'
    col1 ,
    col2
    i defined pk on col1

    Check out..
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_modes.htm#sthref1457
    It states...
    During a direct path load, some integrity constraints are automatically disabled. Others are not. For a description of the constraints, see the information about maintaining data integrity in the Oracle Database Application Developer's Guide - Fundamentals.
    Enabled Constraints
    The constraints that remain in force are:
    NOT NULL
    UNIQUE
    PRIMARY KEY (unique-constraints on not-null columns)Since OP has the primary key in place before starting the DIRECT path load, this is contradictory to what the documentation says or probably a bug?

  • SQL loader load data very slow...

    Hi,
    On my production server have issue of insert. Regular SQL loder load file, it take more time for insert the data in database.
    First 2 and 3 hours one file take 8 to 10 seconds after that it take 5 minutes.
    As per my understanding OS I/O is very slow, First 3 hours DB buffer is free and insert data in buffer normal.
    But when buffer is fill then going for buffer waits and then insert is slow on. If it rite please tell me how to increase I/O.
    Some analysis share here of My server...................
    [root@myserver ~]# iostat
    Linux 2.6.18-194.el5 (myserver) 06/01/2012
    avg-cpu: %user %nice %system %iowait %steal %idle
    3.34 0.00 0.83 6.66 0.00 89.17
    Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
    sda 107.56 2544.64 3140.34 8084953177 9977627424
    sda1 0.00 0.65 0.00 2074066 16
    sda2 21.57 220.59 1833.98 700856482 5827014296
    sda3 0.00 0.00 0.00 12787 5960
    sda4 0.00 0.00 0.00 8 0
    sda5 0.69 2.75 15.07 8739194 47874000
    sda6 0.05 0.00 0.55 5322 1736264
    sda7 0.00 0.00 0.00 2915 16
    sda8 0.50 9.03 5.24 28695700 16642584
    sda9 0.51 0.36 24.81 1128290 78829224
    sda10 0.52 0.00 5.98 9965 19004088
    sda11 83.71 2311.26 1254.71 7343426336 3986520976
    [root@myserver ~]# hdparm -tT /dev/sda11
    /dev/sda11:
    Timing cached reads: 10708 MB in 2.00 seconds = 5359.23 MB/sec
    Timing buffered disk reads: 540 MB in 3.00 seconds = 179.89 MB/sec
    [root@myserver ~]# sar -u -o datafile 1 6
    Linux 2.6.18-194.el5 (mca-webreporting2) 06/01/2012
    09:57:19 AM CPU %user %nice %system %iowait %steal %idle
    09:57:20 AM all 6.97 0.00 1.87 16.31 0.00 74.84
    09:57:21 AM all 6.74 0.00 1.25 17.48 0.00 74.53
    09:57:22 AM all 7.01 0.00 1.75 16.27 0.00 74.97
    09:57:23 AM all 6.75 0.00 1.12 13.88 0.00 78.25
    09:57:24 AM all 6.98 0.00 1.37 16.83 0.00 74.81
    09:57:25 AM all 6.49 0.00 1.25 14.61 0.00 77.65
    Average: all 6.82 0.00 1.44 15.90 0.00 75.84
    [root@myserver ~]# sar -u -o datafile 1 6
    Linux 2.6.18-194.el5 (mca-webreporting2) 06/01/2012
    09:57:19 AM CPU %user %nice %system %iowait %steal %idle
    mca-webreporting2;601;2012-05-27 16:30:01 UTC;2.54;1510.94;3581.85;0.00
    mca-webreporting2;600;2012-05-27 16:40:01 UTC;2.45;1442.78;3883.47;0.04
    mca-webreporting2;599;2012-05-27 16:50:01 UTC;2.44;1466.72;3893.10;0.04
    mca-webreporting2;600;2012-05-27 17:00:01 UTC;2.30;1394.43;3546.26;0.00
    mca-webreporting2;600;2012-05-27 17:10:01 UTC;3.15;1529.72;3978.27;0.04
    mca-webreporting2;601;2012-05-27 17:20:01 UTC;9.83;1268.76;3823.63;0.04
    mca-webreporting2;600;2012-05-27 17:30:01 UTC;32.71;1277.93;3495.32;0.00
    mca-webreporting2;600;2012-05-27 17:40:01 UTC;1.96;1213.10;3845.75;0.04
    mca-webreporting2;600;2012-05-27 17:50:01 UTC;1.89;1247.98;3834.94;0.04
    mca-webreporting2;600;2012-05-27 18:00:01 UTC;2.24;1184.72;3486.10;0.00
    mca-webreporting2;600;2012-05-27 18:10:01 UTC;18.68;1320.73;4088.14;0.18
    mca-webreporting2;600;2012-05-27 18:20:01 UTC;1.82;1137.28;3784.99;0.04
    [root@myserver ~]# vmstat
    procs -----------memory---------- -swap -----io---- system -----cpu------
    r b swpd free buff cache si so bi bo in cs us sy id wa st
    0 1 182356 499444 135348 13801492 0 0 3488 247 0 0 5 2 89 4 0
    [root@myserver ~]# dstat -D sda
    ----total-cpu-usage---- dsk/sda -net/total- -paging -system
    usr sys idl wai hiq siq| read writ| recv send| in out | int csw
    3 1 89 7 0 0|1240k 1544k| 0 0 | 1.9B 1B|2905 6646
    8 1 77 14 0 1|4096B 3616k| 433k 2828B| 0 0 |3347 16k
    10 2 77 12 0 0| 0 1520k| 466k 1332B| 0 0 |3064 15k
    8 2 77 12 0 0| 0 2060k| 395k 1458B| 0 0 |3093 14k
    8 1 78 12 0 0| 0 1688k| 428k 1460B| 0 0 |3260 15k
    8 1 78 12 0 0| 0 1712k| 461k 1822B| 0 0 |3390 15k
    7 1 78 13 0 0|4096B 6372k| 449k 1950B| 0 0 |3322 15k
    AWR sheet output
    Wait Events
    ordered by wait time desc, waits desc (idle events last)
    Event Waits %Time -outs Total Wait Time (s) Avg wait (ms) Waits /txn
    free buffer waits 1,591,125 99.95 19,814 12 129.53
    log file parallel write 31,668 0.00 1,413 45 2.58
    buffer busy waits 846 77.07 653 772 0.07
    control file parallel write 10,166 0.00 636 63 0.83
    log file sync 11,301 0.00 565 50 0.92
    write complete waits 218 94.95 208 955 0.02
    SQL> select 'free in buffer (NOT_DIRTY)',round((( select count(DIRTY) N_D from v$bh where DIRTY='N')*100)/(select count(*) from v$bh),2)||'%' DIRTY_PERCENT from dual
    union
    2 3 select 'keep in buffer (YES_DIRTY)',round((( select count(DIRTY) N_D from v$bh where DIRTY='Y')*100)/(select count(*) from v$bh),2)||'%' DIRTY_PERCENT from dual;
    'FREEINBUFFER(NOT_DIRTY)' DIRTY_PERCENT
    free in buffer (NOT_DIRTY) 10.71%
    keep in buffer (YES_DIRTY) 89.29%
    Rag....

    1)
    Yah This is partition table and on it Local partition index.
    SQL> desc GR_CORE_LOGGING
    Name Null? Type
    APPLICATIONID VARCHAR2(20)
    SERVICEID VARCHAR2(25)
    ENTERPRISENAME VARCHAR2(25)
    MSISDN VARCHAR2(15)
    STATE VARCHAR2(15)
    FROMTIME VARCHAR2(25)
    TOTIME VARCHAR2(25)
    CAMP_ID VARCHAR2(50)
    TRANSID VARCHAR2(25)
    MSI_INDEX NUMBER
    SQL> select index_name,column_name from user_ind_columns where table_name='GR_CORE_LOGGING';
    INDEX_NAME
    COLUMN_NAME
    GR_CORE_LOGGING_IND
    MSISDN
    2) I was try direct but after that i was drop this table and again create new partition table and create fresh index. but still same issue.

  • Java Procedure  to load Oracle Table from flat file

    Hi,
    I am trying to load oracle table from data in flat file.
    Anybody help me out.
    I am using following code but it is giving invalid sql statement error
    try {     
            // Create the statement
          Statement stmt = conn.createStatement();
            // Load the data
         String filename = "c:\\temp\\infile.txt";
         String tablename = "TEST";
         // If the file is comma-separated, use this statement
         stmt.executeUpdate("LOAD DATA INFILE"  + "c:\\temp\\infile.txt" + "INTO TABLE "
         + "TEST" + " FIELDS TERMINATED BY ','");
                 stmt.close();
                 conn.close();
         } catch (SQLException e) {
              e.printStackTrace();
         }I will appriciate your help.
    Thanks.

    I tried the following too but getting same error.
    try {
                        // Create the statement
                        Statement stmt = conn.createStatement();
                        // Load the data
                        String filename = "c:\\temp\\infile.txt";
                        String tablename = "TEST";
                       // If the file is comma-separated, use this statement
                        stmt.executeUpdate("LOAD DATA INFILE \"" + filename + "\" INTO TABLE "
                         + tablename + " FIELDS TERMINATED BY ','");
                        //If the file is terminated by \r\n, use this statement
                        //stmt.executeUpdate("LOAD DATA INFILE \"" + filename + "\" INTO TABLE "
                        //+ tablename + " LINES TERMINATED BY '\\r\\n'");
                                               stmt.close();
                                               conn.close();
                   } catch (SQLException e) {
                        e.printStackTrace();
                   }Any Idea ?

  • Need a logic to load a table

    Hi All,
    I am trying to figure out a logic to load a table from 3 differnt tables... below are the tables
    Contact                                                 
    contact_id        DS_ID                          
    (Number)       (Varchar2)                    
    CR_TYpe
    CR_Type_ID          CR_Type 
    (Number)            (Varchar2)
    Source_CR_Type
    S_CR_Type_ID          CR_TYPE
    (Varchar2)             (Varchar2)Contact.DS_ID =Source_CR_Type.S_CR_Type_ID (the relation between contact and Source_CR_Type is 1:M)
    Distinct Source_CR_Type.CR_TYPE = CR_TYpe.CR_Type
    The table that needs to be loaded is MAP_CON_CR_TYPE
    MAP_CON_CR_TYPE
    MAP_ID          COntact_id          CR_Type_ID             
    (Number)        (Number)            (Number)
    sequencecan any one help me with a logic to load this bridge table or suggest me how to approch.
    Edited by: BluShadow on 15-Feb-2013 15:26
    added {noformat}{noformat} tags for readability.  Please see {message:id=9360002} to learn to do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • Load Multiple Table using SQLLDR

    Hi,
    We are trying to Load Multiple Table using SQLLDR in same loading session.
    Here's a snippet of our script:
    LOAD DATA INFILE '/u07/dd/yyyy_mm_dd.dat'
    append INTO TABLE table1
    WHEN STORE_NO != ' '
    STORE_NO position(1:5) ,
    TR_DATE position(6:27) DATE "mm/dd/yy
    truncate INTO TABLE table2
    WHEN STORE_NO != ' '
    STORE_NO position(1:5) ,
    TR_DATE position(6:27) DATE "mm/dd/yy
    Now upon execution this gives an error saying truncate shouldn't be present before 2nd INTO Clause. The script runs fine if we do same operation say Append / Replcae / Truncate on both tables. My Question here is can we have SQLLDR perform two diff operations (Append & Truncate in our case) in one session?
    Thanks
    Chinmay
    PS: Referred to http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_load_data_from_multiple_files.2F_into_multiple_tables_at_once.3F already

    No.
    did you read the syntax diagram and the paragraph below:
    "When you are loading a table, you can use the INTO TABLE clause to specify a table-specific loading method (INSERT, APPEND, REPLACE, or TRUNCATE) that applies only to that table. That method overrides the global table-loading method. The global table-loading method is INSERT, by default, unless a different method was specified before any INTO TABLE clauses."

  • Exel to SQL DFTask loads some Null records

    I have an SSIS package to import Excel data into SQL. When I look at Excel I dont see ANY Null rows. However when I run the SSIS package and check SQL, It loads some NULL RECORDS IN SQL. WHy is that It loads Null records in SQL, When i cannot see the Null
    recs In Excel?

    That's because the person who created the Excel file and added the data to it pressed the "Enter" key on some of the empty cells under that specific column. In excel, such a row might look like any other empty, non-data row but for SSIS, its an
    actual data row except that it doesn't have any value. SSIS treats a missing data value as a DBNULL and that's what you saw.
    There are multiple ways of fixing this. 
    1. Educate the creator of the excel to be more careful at the time of data entry.
    2. Make that target column in the DB table as NOT NULL. 
    3. Handle such "empty" data values as exception inside your SSIS (using a data flow task and ignoring such rows).
    4. Switch to using CSV file format instead of excel format.
    5. All of the above :)
    Hope this helps.
    Cheers!
    Muqadder.

  • How to resolve error when Loading External Table?

    I’m getting the following errors when attempting to load External Table -- I've changed the file extension from .csv to .txt to resolve ORA-29913 but error re-occurred. See syntax of External Table below.
    Thanks,
    Carol-Ann
    SQL> desc OWB_COUNTY_TIMEZONE_EXT;
    Name Null? Type
    STATE_CODE VARCHAR2(2)
    COUNTY_CODE VARCHAR2(3)
    TIME_ZONE VARCHAR2(1)
    SQL> select count(*) from OWB_COUNTY_TIMEZONE_EXT;
    select count(*) from OWB_COUNTY_TIMEZONE_EXT
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file owb_county_timezone.log
    OS error Permission denied
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    ++++++++++++++++++++++++++++++++++++++++++++++
    Synatx of External Table:
    WHENEVER SQLERROR EXIT FAILURE;
    CREATE TABLE "OWB_COUNTY_TIMEZONE_EXT"
    "STATE_CODE" VARCHAR2(2),
    "COUNTY_CODE" VARCHAR2(3),
    "TIME_ZONE" VARCHAR2(1))
    ORGANIZATION EXTERNAL (
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY AIMQRYD_AIMP_LOC_FF_MODULE_LOC
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY NEWLINE
    CHARACTERSET WE8MSWIN1252
    STRING SIZES ARE IN BYTES
    BADFILE 'owb_county_timezone'
    DISCARDFILE 'owb_county_timezone'
    LOGFILE 'owb_county_timezone'
    FIELDS
    TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"' AND '"'
    NOTRIM
    MISSING FIELD VALUES ARE NULL
    "STATE_CODE" ,
    "COUNTY_CODE" ,
    "TIME_ZONE"
    LOCATION (
    AIMQRYD_AIMP_LOC_FF_MODULE_LOC:'county_timezone_comma.txt'
    REJECT LIMIT UNLIMITED
    NOPARALLEL

    Hi Carol-Ann,
    The key issue here is
    "KUP-04063: unable to open log file owb_county_timezone.log
    OS error Permission denied".
    Looks like you don't have sufficient system priviliges on Unix.
    This is wat AskTom mentions about it:
    "the directory must exist on the SERVER.
    the concerned user is the "oracle software owner" as far as the OS is concerned.
    oracle must have read write access to this directory
    and the directory must exist on the SERVER (database server) itself."
    Hope this helps.
    Cheers, Patrick

  • How to load Foxpro table?

    Hi,
    I am Senthil Kumar.
    I am connecting to foxpro database.
    Its connection sucessfull.
    but could not load foxpro table.
    I am using "com.hxtt.sql.dbf.DBFDriver" this driver file for foxpro.
    If anybody's know, please help me.
    Here is the error message:
    ``````````````````````````````````
    java.sql.SQLException: java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.greatautoparts.com/../../carsteering_com/data/complete_tables//model.DBF at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at com.hxtt.concurrent.i.l(Unknown Source) at com.hxtt.concurrent.i.a(Unknown Source) at com.hxtt.concurrent.t.do(Unknown Source) at com.hxtt.concurrent.t.if(Unknown Source) at com.hxtt.concurrent.t.a(Unknown Source) at com.hxtt.sql.dbf.i.b(Unknown Source) at com.hxtt.sql.dbf.i.void(Unknown Source) at com.hxtt.sql.dbf.d.a(Unknown Source) at com.hxtt.sql.dbf.d.(Unknown Source) at com.hxtt.sql.dbf.u.a(Unknown Source) at com.hxtt.sql.bm.if(Unknown Source) at com.hxtt.sql.dc.a(Unknown Source) at com.hxtt.sql.dc.a(Unknown Source) at com.hxtt.sql.bm.a(Unknown Source) at com.hxtt.sql.bm.a(Unknown Source) at com.hxtt.sql.ag.a(Unknown Source) at com.hxtt.sql.ag.a(Unknown Source) at com.hxtt.sql.ag.executeQuery(Unknown Source) at org.apache.jsp.FoxproJDBCTest_jsp._jspService(org.apache.jsp.FoxproJDBCTest_jsp:63) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:524) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source)
    Thanks,
    K.Senthil Kumar

    Hi,
    If you are having problems loading data from a file using SQLLDR, even if it is from Foxpro then it is probably better to ask about it in the SQL*Loader forum -
    Export/Import/SQL Loader & External Tables
    Regards,
    Mike

Maybe you are looking for

  • New mac mini, resolution incompatible with TV

    My shiny new mac mini just arrived today in the mail. I hooked it up to my Emerson 27 inch 720p tv and booted her up. I got the grey screen, then the apple, then a spinny wheel of white lights, then "Please change computers resolution". This is my fi

  • Lightroom 3 Print Moduel Layout Style not working??

    Hi all, With no change in Lightroom, all of a sudden I have issues with the "picture package" and "custom package" settings within the layout styles in the print module. For instance, if you are in "single image/contact sheet" and you have an image s

  • Problem faced in form while deleting a record-urgent

    we r in the testing stage of our project. we are facing a major problem. In one of the forms deletion is not working. we did migration from 6i to 10g. we migrated using migration assistant. in 6i code was working fine. in 10g record is not getting de

  • Creation of Vendor using a BAPI

    I need to create a vendor in SAP system from a non-SAP system. I thought to use a BAPI. But the BAPI available, BAPI_VENDOR_CREATE is not suitable as it is dialog oriented. Could anyone suggest me a better method of achieving this. Raja

  • Viewing a document created on ios on my Mac with Pages 5.0 wihtout sharing via icloud?

    I have Pages 5.0 on my ios device and Mac. When I create a document on my Mac in Pages it will automatically appear on my Pages app on my ios. But when I create a docuemnt on my ios it will not generate on my Mac. I'm pretty sure it used to do this b