Loading two tables at same time with SQL Loader

I have two tables I would like to populate from a file C:\my_data_file.txt.
Many of the columns I am loading into both tables but there are a handful of columns I do not want. The first column I do not want for either table. My problem is how I can direct SQL Loader to go back to the first column and skip over it. I had tried using POSITION(1) and FILLER for the first column while loading the second table but I got THE following error message:
SQL*Loader-350: Syntax error at line 65
Expecting "," or ")" found keyword Filler
col_a Poistion(1) FILLER INTEGER EXTERNALMy control file looks like the following:
LOAD DATA
INFILE 'C:\my_data_file.txt'
BADFILE 'C:\my_data_file.txt'
DISCARDFILE 'C:\my_data_file.txt'
TRUNCATE INTO TABLE table_one
WHEN (specific conditions)
FIELDS TERMINATED BY ' '
TRAILING NULLCOLS
col_a FILLER INTEGER EXTERNAL,
col_b INTEGER EXTERNAL,
col_g FILLER CHAR,
col_h CHAR,
col_date DATE "yyyy-mm-dd"
INTO TABLE table_two
WHEN (specific conditions)
FIELDS TERMINATED BY ' '
TRAILING NULLCOLS
col_a POSITION(1) FILLER INTEGER EXTERNAL,
col_b INTEGER EXTERNAL,
col_g FILLER CHAR,
col_h CHAR,
col_date DATE "yyyy-mm-dd"
)

Try adapting this for your scenario.
tables for the test
create table test1 ( fld1 varchar2(20), fld2 integer, fld3 varchar2(20) );
create table test2 ( fld1 varchar2(20), fld2 integer, fld3 varchar2(20) );
control file
LOAD DATA
INFILE "test.txt"
INTO TABLE user.test1 TRUNCATE
WHEN RECID = '1'
FIELDS TERMINATED BY ' '
recid filler integer external,
fld1 char,
fld2 integer external,
fld3 char
INTO TABLE user.test2 TRUNCATE
WHEN RECID <> '1'
FIELDS TERMINATED BY ' '
recid filler position(1) integer external,
fld1 char,
fld2 integer external,
fld3 char
data for loading [text.txt]
1 AAAAA 11111 IIIII
2 BBBBB 22222 JJJJJ
1 CCCCC 33333 KKKKK
2 DDDDD 44444 LLLLL
1 EEEEE 55555 MMMMM
2 FFFFF 66666 NNNNN
1 GGGGG 77777 OOOOO
2 HHHHH 88888 PPPPP
HTH
RK

Similar Messages

  • How can I load data into table with SQL*LOADER

    how can I load data into table with SQL*LOADER
    when column data length more than 255 bytes?
    when column exceed 255 ,data can not be insert into table by SQL*LOADER
    CREATE TABLE A (
    A VARCHAR2 ( 10 ) ,
    B VARCHAR2 ( 10 ) ,
    C VARCHAR2 ( 10 ) ,
    E VARCHAR2 ( 2000 ) );
    control file:
    load data
    append into table A
    fields terminated by X'09'
    (A , B , C , E )
    SQL*LOADER command:
    sqlldr test/test control=A_ctl.txt data=A.xls log=b.log
    datafile:
    column E is more than 255bytes
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1006961

  • When our iPad is in use on the internet, my iMac internet connection goes off. I can't get the two devices to work at the same time with the AirPort Express. Is there a setting somewhere I may have missed?

    When our iPad is in use on the internet, my iMac internet connection goes off. I can't get the two devices to work at the same time with the AirPort Express. Is there a setting somewhere I may have missed?

    When two or more devices conflict it typically means that the DHCP service is either misconfigured or is not running at all. DHCP provides IP addresses to local network clients.
    Is your AirPort Express base station the only router in your current network configuration? That is, is it connected directly to an Internet modem and not to another router upstream of it?

  • Sql@loader-704  and ORA-12154: error messages when trying to load data with SQL Loader

    I have a data base with two tables that is used by Apex 4.2. One table has 800,000 records . The other has 7 million records
    The client recently upgraded from Apex 3.2 to Apex 4.2 . We exported/imported the data to the new location with no problems
    The source of the data is an old mainframe system; I needed to make changes to the source data and then load the tables.
    The first time I loaded the data i did it from a command line with SQL loader
    Now when I try to load the data I get this message:
    sql@loader-704 Internal error: ulconnect OCISERVERATTACH
    ORA-12154: tns:could not resolve the connect identifier specified
    I've searched for postings on these error message and they all seem to say that SQL Ldr can't find my TNSNAMES file.
    I am able to  connect and load data with SQL Developer; so SQL developer is able to find the TNSNAMES file
    However SQL Developer will not let me load a file this big
    I have also tried to load the file within Apex  (SQL Workshop/ Utilities) but again, the file is too big.
    So it seems like SQL Loader is the only option
    I did find one post online that said to set an environment variable with the path to the TNSNAMES file, but that didn't work..
    Not sure what else to try or where to look
    thanks

    Hi,
    You must have more than one tnsnames file or multiple installations of oracle. What i suggest you do (as I'm sure will be mentioned in ed's link that you were already pointed at) is the following (* i assume you are on windows?)
    open a command prompt
    set TNS_ADMIN=PATH_TO_DIRECTOT_THAT_CONTAINS_CORRECT_TNSNAMES_FILE (i.e. something like set TNS_ADMIN=c:\oracle\network\admin)
    This will tell oracle use the config files you find here and no others
    then try sqlldr user/pass@db (in the same dos window)
    see if that connects and let us know.
    Cheers,
    Harry
    http://dbaharrison.blogspot.com

  • Expert Help needed with Sql Loader !

    Hello Friends...I am using one .dat file that contains several values in a
    particular column and I need to load those values in different tables with
    sqlloader.....For example: in column 3 there are values 0001, 0004, 0007, 9999
    ..> values 0001 and 0004 need to be loaded into table1 and value 0007 is
    loaded into table2 and value 9999 needs to be loaded into table3.
    I can successfully use the when clause to load one value at a time but
    cannot load a range or multiple values during the sqlloader load. I can
    call and run separate .ctl files but less complexity and fewer files would
    be better. Tried everything I know but no luck, can't do loads in same
    .ctl file......Does the when clause have limitations whereby only one value
    at a time can evaluated as True or False ?
    I would like to do a Not or InBetween evaluations if possible on that
    single coulmn and then do the loads in the specific tables.
    Any help would be appreciated as I can see my hair turn grayer by the
    minute..My thanks in advance..

    You're asking sql*load to perform an unnatural act.
    Load in you dat file as-is. Create a pl/sql procedure to do the rest.
    Your batch script calls sql*load, then sql*plus to run the proc.
    Must simpler. sql*load is not a procedural language.

  • How to compare two tables data...need sql report or utility to find differe

    Hi,
    We have a requirement where we are asked to find data differences between two tables and one of the tables reside on remote database. The database version is same ( 10g ) and datatypes for the tables are similar.
    The client is looking for a sql report or kind of utility to display the data differences for each column ( if possible count differences ) with some meaningful error messages.
    Could anyone let me know the best possible way of doing it..?
    Thanks
    Hitarth

    Hi,
    I found something for tables comparison but getting one error...can you check this please and let me know what is wrong
    Here is the function:
    CREATE OR REPLACE FUNCTION compare_query_results (
    p_query1 IN VARCHAR2
    , p_query2 IN VARCHAR2
    , p_raise_error_if_not_equal IN BOOLEAN DEFAULT FALSE
    , p_raise_error_if_no_rows IN BOOLEAN DEFAULT FALSE
    RETURN NUMBER
    IS
    -- Constants
    c_query_results_equal CONSTANT PLS_INTEGER := 0;
    c_query_results_not_equal CONSTANT PLS_INTEGER := 1;
    oracr CONSTANT VARCHAR2 (1) := CHR (10);
    -- Variable Declaration
    v_sql_stmt VARCHAR2 (32767);
    v_record_count PLS_INTEGER;
    v_return_code PLS_INTEGER;
    v_record DUAL.dummy%TYPE;
    v_result_set_has_rows BOOLEAN;
    -- Ref Cursors
    v_cursor sys_refcursor;
    -- Custom Defined-Exceptions
    result_sets_do_not_match EXCEPTION;
    query_returns_no_rows EXCEPTION;
    BEGIN
    -- Get the count of differing records between p_query1 and p_query2
    dbms_output.put_line('Start-1');
    v_sql_stmt :=
    ' (SELECT /*+ materialize */'
    || SUBSTR (p_query1, INSTR (UPPER (p_query1)
    , 'SELECT'
    , 1
    , 1
    ) + 6)
    || ')
    , (SELECT /*+ materialize */'
    || SUBSTR (p_query2, INSTR (UPPER (p_query2)
    , 'SELECT'
    , 1
    , 1
    ) + 6)
    || ')
    SELECT ''X''
    FROM (
    (SELECT * FROM test1 MINUS SELECT * FROM test2)
    UNION ALL
    (SELECT * FROM test2 MINUS SELECT * FROM test1)
    dbms_output.put_line('Start-2');
    OPEN v_cursor
    FOR v_sql_stmt;
    dbms_output.put_line('Start-3');
    FETCH v_cursor
    INTO v_record;
    dbms_output.put_line('Start-4');
    v_result_set_has_rows := v_cursor%FOUND;
    dbms_output.put_line('Start-5');
    CLOSE v_cursor;
    dbms_output.put_line('Start-6');
    -- If there are rows - the result sets do NOT match...
    IF v_result_set_has_rows
    THEN
    v_return_code := c_query_results_not_equal;
    IF p_raise_error_if_not_equal
    THEN
    RAISE result_sets_do_not_match;
    END IF;
    -- If there are no rows - the result sets do match...
    ELSIF NOT v_result_set_has_rows
    THEN
    IF p_raise_error_if_no_rows
    THEN
    -- Check to make sure that the queries contain rows if desired...
    v_sql_stmt := 'SELECT ''X''
    FROM (' || oracr || p_query1 || oracr || ')';
    OPEN v_cursor
    FOR v_sql_stmt;
    FETCH v_cursor
    INTO v_record;
    IF v_cursor%NOTFOUND
    THEN
    CLOSE v_cursor;
    RAISE query_returns_no_rows;
    END IF;
    CLOSE v_cursor;
    END IF;
    v_return_code := c_query_results_equal;
    END IF;
    RETURN v_return_code;
    EXCEPTION
    WHEN result_sets_do_not_match
    THEN
    raise_application_error (-20101, 'The Queries'' result sets do NOT match. Error returned
    as requested.');
    WHEN query_returns_no_rows
    THEN
    raise_application_error (-20102, 'The Queries'' result sets match, however they contain no
    rows. Error returned as requested.');
    WHEN OTHERS
    THEN
    -- Raise the error
    raise_application_error (-20103
    , 'There is a syntax or semantical error in one or both queries
    preventing comparison.'
    || oracr
    || 'Error Stack :'
    || oracr
    || DBMS_UTILITY.format_error_stack ()
    || oracr
    || 'Error_Backtrace:'
    || oracr
    || DBMS_UTILITY.format_error_backtrace ());
    END compare_query_results;
    I have created two tables ( test1 and test2 ) with few columns and with the same datatypes and executed the above function...I am getting error as folliowing:
    DECLARE
    ERROR at line 1:
    ORA-20103: There is a syntax or semantical error in one or both queries
    preventing comparison.
    Error Stack :
    ORA-00900: invalid SQL statement
    Error_Backtrace:
    ORA-06512: at "ORAOWNER.COMPARE_QUERY_RESULTS", line 53
    ORA-06512: at "ORAOWNER.COMPARE_QUERY_RESULTS", line 121
    ORA-06512: at line 12
    Could someone please help me fixing this error..It would be really appreciated
    Thanks
    Hitarth

  • Loading data with sql loader

    Hi Experts,
    I have a file with the following format. I have to insert the data of those files in a table. I can use SQL Loader to load those files.
    My question is I need to schedule the upload of those files. Can i incorporate 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Yes sorry about that mishap
    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|||||||||||||1|-2145916800|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|||||This is my file format which is a .txt file

  • Loading Objects with SQL*Loader

    When loading a column object with SQL*Loader, is it possible to specify a column specific 'TERMINATED BY' clause in the control file?
    I've successfully defined column-level termination characters for regular columns and nested tables, but can't seem to find any way of achieving the same result with column objects.

    When loading a column object with SQL*Loader, is it possible to specify a column specific 'TERMINATED BY' clause in the control file?
    I've successfully defined column-level termination characters for regular columns and nested tables, but can't seem to find any way of achieving the same result with column objects.

  • Need help with SQL*Loader not working

    Hi all,
    I am trying to run SQL*Loader on Oracle 10g UNIX platform (Red Hat Linux) with below command:
    sqlldr userid='ldm/password' control=issue.ctl bad=issue.bad discard=issue.txt direct=true log=issue.log
    And get below errors:
    SQL*Loader-128: unable to begin a session
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux-x86_64 Error: 2: No such file or directory
    Can anyone help me out with this problem that I am having with SQL*Loader? Thanks!
    Ben Prusinski

    Hi Frank,
    More progress, I exported the ORACLE_SID and tried again but now have new errors! We are trying to load an Excel CSV file into a new table on our Oracle 10g database. I created the new table in Oracle and loaded with SQL*Loader with below problems.
    $ export ORACLE_SID=PROD
    $ sqlldr 'ldm/password@PROD' control=prod.ctl log=issue.log bad=bad.log discard=discard.log
    SQL*Loader: Release 10.2.0.1.0 - Production on Tue May 23 11:04:28 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL*Loader: Release 10.2.0.1.0 - Production on Tue May 23 11:04:28 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Control File: prod.ctl
    Data File: prod.csv
    Bad File: bad.log
    Discard File: discard.log
    (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 TESTLD, loaded from every logical record.
    Insert option in effect for this table: REPLACE
    Column Name Position Len Term Encl Datatype
    ISSUE_KEY FIRST * , CHARACTER
    TIME_DIM_KEY NEXT * , CHARACTER
    PRODUCT_CATEGORY_KEY NEXT * , CHARACTER
    PRODUCT_KEY NEXT * , CHARACTER
    SALES_CHANNEL_DIM_KEY NEXT * , CHARACTER
    TIME_OF_DAY_DIM_KEY NEXT * , CHARACTER
    ACCOUNT_DIM_KEY NEXT * , CHARACTER
    ESN_KEY NEXT * , CHARACTER
    DISCOUNT_DIM_KEY NEXT * , CHARACTER
    INVOICE_NUMBER NEXT * , CHARACTER
    ISSUE_QTY NEXT * , CHARACTER
    GROSS_PRICE NEXT * , CHARACTER
    DISCOUNT_AMT NEXT * , CHARACTER
    NET_PRICE NEXT * , CHARACTER
    COST NEXT * , CHARACTER
    SALES_GEOGRAPHY_DIM_KEY NEXT * , CHARACTER
    value used for ROWS parameter changed from 64 to 62
    Record 1: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 2: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 3: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 4: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 5: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 6: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 7: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 8: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 9: Rejected - Error on table ISSUE_FACT_TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 10: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 11: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 12: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 13: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 14: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 15: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 16: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 17: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 18: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 19: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 20: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 21: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 22: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 23: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 24: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 39: Rejected - Error on table TESTLD, column DISCOUNT_AMT.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    MAXIMUM ERROR COUNT EXCEEDED - Above statistics reflect partial run.
    Table TESTLD:
    0 Rows successfully loaded.
    51 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: 255936 bytes(62 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 51
    Total logical records rejected: 51
    Total logical records discarded: 0
    Run began on Tue May 23 11:04:28 2006
    Run ended on Tue May 23 11:04:28 2006
    Elapsed time was: 00:00:00.14
    CPU time was: 00:00:00.01
    [oracle@casanbdb11 sql_loader]$
    Here is the control file:
    LOAD DATA
    INFILE issue_fact.csv
    REPLACE
    INTO TABLE TESTLD
    FIELDS TERMINATED BY ','
    ISSUE_KEY,
    TIME_DIM_KEY,
    PRODUCT_CATEGORY_KEY,
    PRODUCT_KEY,
    SALES_CHANNEL_DIM_KEY,
    TIME_OF_DAY_DIM_KEY,
    ACCOUNT_DIM_KEY,
    ESN_KEY,
    DISCOUNT_DIM_KEY,
    INVOICE_NUMBER,
    ISSUE_QTY,
    GROSS_PRICE,
    DISCOUNT_AMT,
    NET_PRICE,
    COST,
    SALES_GEOGRAPHY_DIM_KEY
    )

  • How to have more than one condition on same column --- using SQL Loader

    Hi All,
    I am stuck with SQL Loader..
    How do I filter records before loading in the table using when clause..
    i should load data only when
    field1 = 'AC' or 'VC'
    field2 is NULL
    i used various combinations in when clause like
    a) when field1='AC' or field1='VC' and field2 = BLANKS
    b) when (field1='AC') and (field2 = BLANKS )
    & similar...
    In all the cases I tried I could not implement OR condition with field1 and null condition with field2
    but my main concern is can we use OR or IS NULL things in when clause of SQL Loader..
    is it possible to check this anywhere??
    any alternate solution u could suggest??
    Thanks
    Dikshit

    Ok I'll try that, although I did try it earlier when I had iTunes 5.xx loaded, I think.
    As to size of playlists, I have a master (900 songs) that defines what will fit onto the ipod , I then generate all the others as subsets of the master (not of the library)- hence I know they will all fit
    Can you also clarify something for me: the dialogue box we are discussing is intended, I think, so that one can set the automatic synching of certain playlists between the PC & the ipod. Is that the only way one can select other playlists to go to the ipod - i.e. as static once-offs, not synchronised ?
    Apple' docs, I think, are poor in this regard - they assume most ipods are bigger then the users song library and they gloss over the details of this alternate mode of playlist synching.
    Thanks - Nick

  • Failed to upgrade more than one table at same time

    Hi
    In Deployment Manager, I failed to upgrade more than one table at same time.
    I tried to hightlight 4 tables and set the default action as Upgrade, and click File/Generate Deploy. It passed the code generation step then I click Deploy, they are all failed with no error message.
    But they are all successful when I upgrade them one by one. Any one has any idea about this?
    For the known reason, we have no choice to do the deployment with action of 'upgrade' through OMBPlus, instead, can only do that interactively through OWB Client. I can't imagine to ask our Production side DBA to upgrade 80 tables one by one. Or I have to use the generated scripts to do the upgrade, which will resulted in 'no deploy status updated' in OWB. Any help will be very appricated.
    The version I'm using is OWB 10g.
    Thanks,
    Daming

    Hi
    First of all, Patrick's solution doesn't work for me. I didn't do cloning and there is no problem when check the WB tables.
    Second, I think your solution is only good for the developing environment just to get tables upgrade via deployment manager. In most cases, when you do a new release on PROD environment you just exp/imp the MDL file from DEV to PROD and any developing is not recommended on PROD. But your approach is trying to manually the DB, and then EDIT the mapping to do the Reconcile and then deploy. Surely you can do that if you have full control on your PROD side. However, in my situation, I have no access to the PROD for the security reason and an DBA Operator of the Client is responsible to implement my Migration process on PROD by himself.

  • Problem with loading file with SQL loader

    i am getting a problem with loading a file with SQL loader. The loading is getting
    terminated after around 2000 rows whereas there are around 2700000 rows in the file.
    The file is like
    919879086475,11/17/2004,11/20/2004
    919879698625,11/17/2004,11/17/2004
    919879698628,11/17/2004,11/17/2004
    the control file, i am using is like:-
    load data
    infile 'c:\ran\temp\pps_fc.txt'
              into table bm_05oct06
    fields terminated by ","
    (mobile_no, fcal, frdate )
    I hope, my question is clear. Please help, in solving the doubt.
    regards.

    So which thread is telling the truth?
    Doubt with SQL loader file wih spaces
    Are the fields delimited with spaces or with commas?
    Perhaps they are a mixture of delimiters and that is where the error is coming in?

  • Ignoring constraints with SQL*Loader & triggers

    When I load a table with SQL*Loader that has foreign key constraints and a before insert trigger, my foreign key constraints are ignored. The end result is a detail table that contains invalid rows (where some column values do not exist in the master table). If I drop the trigger and just load with SQL*Loader, the foreign key constraints are recognized. Any ideas why this is happening? The trigger simply populates the last updated date and user columns.

    I found this from Asktom very nice. It will help u a lot.
    http://asktom.oracle.com/pls/ask/f?p=4950:9:1988009758486146475::NO:9:F4950_P9_DISPLAYID:8806498660292

  • 16 channels of audio recording at the same time with a MAC BOOK?

    Hi,
    I want to know how many channels of audio I can record at the same-time with a MAC BOOK (2.16GHz Intel Core 2 Duo, 1GB memory 120GB hard drive, Double-layer SuperDrive), firewire audio device and Logic Pro 8?
    You see I am aiming to record a live gig and I want to come into a firewire recording interface with 16 channels of audio all at the same time (24-bit, 44Khz) Does anyone know if this is possible? Or am I looking for trouble? No plug-ins will be used just record straight in. Anyone have some experience with this?
    Thanks.

    Ok, like this:
    Macbook - FW Port - FW Cable -In- MOTU Traveler -Out- External Harddrive.
    Firewire is capable of chaining units.
    Also plugged into your motu traveler will be an optical cable coming from the ADA.
    This will carry the 8 channels of audio it outputs.
    Also another good thing to do is to also have an optical cable FROM the optical output of your Traveler into the Behringer's input.
    That way you can sync the Behringer's digital clock to that of the Traveler, giving you a slightly better sounding signal that if you were to sync the traveler to the Behringer. This is simply because the traveler has a better quality digital clock than the Behringer unit so it's best to use that. To do this you just select "Adat input" on the back of the Behringer, and leave the Travelers sync to "Internal Clock". It is only a very very slight difference and you may not be able to notice the difference but for the cost of an optical cable it's worth doing.
    It will all make a lot more sense when you have the two units and the harddrive all plugged in.

  • Problem with loading sdo_geometry with sql loader

    Hi All,
    I i'm trying to load some geometries, and i'm using sql loader for that.
    example entry of my data file looks like this:
    1,01030000000100000011000000af8916eafaf7284014c8917307f54540645ddc4603f82840d7b7dd150bf5454084ab4dad08f828401cfc0e8f0ef54540c987eaf70ef828404469143713f54540c987eaf70ef828404469143713f54540d13131a715f82840d44c52f41bf54540e148fb7a19f82840e2e1e24d23f54540e148fb7a19f82840e2e1e24d23f545403abcd6941af828400b13a16c25f5454091c71d801ef82840b8efac3830f54540c58cf0f620f8284039cbd1883ef54540c58cf0f620f8284039cbd1883ef545406659e6632df82840eb80351834f545403bf9991f24f828404bf37d271cf54540e3c281902cf8284012633ec516f54540b66a323e27f82840181d35cb0af54540af8916eafaf7284014c8917307f54540
    Geometry is stored in wkb format. To be able to add SRID information to geometry i created the function in database which looks like this:
    create or replace function sdo_geom_form_wkb_text(wkb_text IN VARCHAR2) RETURN
    sdo_geometry as
    SRID_VALUE NUMBER := 8307;
    BEGIN
    return sdo_geometry(to_blob(HEXTORAW(wkb_text)), SRID_VALUE);
    end sdo_geom_form_wkb_text;
    and i would like to invoke this method during load. To do this i look in some forums where there were examples with using from_wkt function and i made my own ctl file:
    OPTIONS (SKIP=0,BINDSIZE=20000000,ROWS=10000,ERRORS=500,DIRECT=true)
    LOAD DATA
    INFILE 'c:\geometry\face2.dat'
    BADFILE 'c:\geometry\face2.bad'
    TRUNCATE
    CONTINUEIF NEXT(1:1) = '#'
    INTO TABLE TEST_TABLE
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS (
    ID INTEGER EXTERNAL,
    string_geom BOUNDFILLER,
    GEOMETRY EXPRESSION "sdo_geom_form_wkb_text(:string_geom)"
    when i invoke sqlloader i'm getting:
    SQL*Loader-951: Error calling once/load initialization
    ORA-26052: Unsupported type 121 for SQL expression on column GEOMETRY.
    Could anyone tell what i'm doing wrong?
    Thanks,

    864742,
    . . . .Forget the function and use the SDO_GEOMETRY constructor.
    -- "NOTE: here I'm assuming your SRID is 8307"
    ID          INTEGER EXTERNAL,
    string_geom BOUNDFILLER,
    GEOMETRY    EXPRESSION "SDO_GEOMETRY(:string_geom, 8307)"
    .... . . .Credit
    Regards,
    Noel

Maybe you are looking for