Regarding Sql Loader(All WHEN Clause Failed)

Below is my control file
LOAD DATA
INFILE 'DATA.dat'
BADFILE 'MLIMA.bad'
INTO TABLE Brok_Gl_Interface
APPEND
WHEN record_type = '10'
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
     record_type     CHAR ,
     currency     CHAR ,
     entity          CHAR ,
     cost_centre     CHAR ,
     usd_account     CHAR ,
     amount          CHAR
INTO TABLE Brok_Gl_Interface
WHEN record_type = '99'
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
     record_type     CHAR ,
     record_count CHAR
INTO TABLE Brok_Gl_Interface
WHEN record_type = '00'
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
     record_type CHAR,
     run_date CHAR,
     effective_date CHAR               
below is my data file
00,05062006,02062006,
10,EUR,82G,82GE00,46005AA600,78827.41,
10,GBP,82G,82GE00,46005AA600,-2820955.63,
10,GBP,82G,82GE00,46005AA600,340252.39,
10,GBP,82G,82GE00,46007AB100,-1665483.26,
10,EUR,82G,82GE38,46007AB100,-38924.00,
99,95,
At the time of execution the condition which is 1st is only working for others i am getting the error message 'All When Clause Failed'
pl'z help me out.

I have also faced a similar problem like this. Try this control file
LOAD DATA
INFILE 'DATA.dat'
BADFILE 'MLIMA.bad'
INTO TABLE Brok_Gl_Interface
APPEND
WHEN record_type = '10'
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
record_type CHAR ,
currency CHAR ,
entity CHAR ,
cost_centre CHAR ,
usd_account CHAR ,
amount CHAR
INTO TABLE Brok_Gl_Interface
WHEN record_type = '99'
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
record_type POSITION(1) CHAR ,
record_count CHAR
INTO TABLE Brok_Gl_Interface
WHEN record_type = '00'
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
record_type POSITION(1) CHAR,
run_date CHAR,
effective_date CHAR
)Regards,
Mohana

Similar Messages

  • SQL*LOADER, the WHEN clause and WILDCARDS

    has anybody ever used wildcards in a WHEN clause in the SQL*LOADER control file?
    WHEN string_2_load = 'GOOD' , all 'good' rows load
    WHEN string_2_load = 'GO%', all rows fail the WHEN clause and end up in the discard file.
    thanks in advance - if i don't go crazy first
    burt

    I have also faced a similar problem like this. Try this control file
    LOAD DATA
    INFILE 'DATA.dat'
    BADFILE 'MLIMA.bad'
    INTO TABLE Brok_Gl_Interface
    APPEND
    WHEN record_type = '10'
    FIELDS TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    record_type CHAR ,
    currency CHAR ,
    entity CHAR ,
    cost_centre CHAR ,
    usd_account CHAR ,
    amount CHAR
    INTO TABLE Brok_Gl_Interface
    WHEN record_type = '99'
    FIELDS TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    record_type POSITION(1) CHAR ,
    record_count CHAR
    INTO TABLE Brok_Gl_Interface
    WHEN record_type = '00'
    FIELDS TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    record_type POSITION(1) CHAR,
    run_date CHAR,
    effective_date CHAR
    )Regards,
    Mohana

  • SQLLoader: when clause fails

    Hi,
    I'm working on an
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, Automatic Storage Management, OLAP, Data Mining
    and Real Application Testing options
    I've to load a file into 2 different tables, and I'm tring to do that using sqlloader and one single control file.
    This the (part of) source file:
    "1","20110228155443","21970","671","3","","LISSETTE CAROLIN","MORALES COBO","","","V11283202","UBICAR123","","",""
    "1","20110228160121","21971","671","3","","RAFAEL GREGORIO","BRIÃEZ ZAMBRANO","","0","","","","",""
    "1","20110228160505","21972","14782","3","","Noelia","Parrales","","","RRHH","rrhh123","","",""
    "1","20110228163120","21973","671","3","","JOSE GREGORIO","PEREZ","","0","","","","",""
    "1","20110228165534","21974","671","3","","CARMEN","ARAUJO","","","V15753282","UBICAR123","","",""
    "2","20110228044646","12005","1","0","","","Cellocator Test","4","0","COMPACT 268852","","","","","","","","",
    "2","20110228084454","22012","1","3","","","POLO","22","0","EG727SV","20110223000000","MASSIMO","PAMELA","WVWZZZ6RZBY201299","","","","",
    "2","20110228085219","20378","1","22","","","ASTRA","4","0","EF774ND","20110120000000","ER3497","X","WOLPF6EN3BG059489","","","","",
    "2","20110228091127","22122","1","3","","","GOLF","4","0","EG766SV","20110224000000","BALGARION","VETURIA","WVWZZZ1KZBW215645","","","","",And this is the control file:
    OPTIONS ( DIRECT=FALSE,PARALLEL=TRUE, ERRORS=0, BINDSIZE=50000, ROWS=1000, READSIZE=65536)
    LOAD DATA
    CHARACTERSET UTF8
    TRUNCATE
    INTO TABLE "STG_ITALY"."STG_USER"
      WHEN TYPE_ = "1"
    FIELDS terminated by ',' enclosed by '"' TRAILING NULLCOLS
       "TYPE_" INTEGER EXTERNAL,
       "DATE_MODIFY" "TO_DATE(:DATE_MODIFY, 'YYYYMMDDHH24MISS')",
       "ID_USER" INTEGER EXTERNAL,
       "ID_USER_PARENT" INTEGER EXTERNAL,
       "I_TYPE_USER" INTEGER EXTERNAL,
       "COMPANY_NAME" CHAR,
       "FIRST_NAME" CHAR,
       "LAST_NAME" CHAR,
       "MIDDLE_NAME" CHAR,
       "I_NATIONALITY" INTEGER EXTERNAL,
       "LOGIN_NAME" CHAR,
       "LOGIN_PASSWORD" CHAR,
       "NOTE" CHAR,
       "DATE_VALID_TO" "TO_DATE(:DATE_VALID_TO, 'YYYYMMDDHH24MISS')",
       "ID_USER_VALID_TO" INTEGER EXTERNAL
    INTO TABLE "STG_ITALY"."STG_VEHICLE"
      WHEN TYPE_ = "2"
    FIELDS terminated by ',' enclosed by '"' TRAILING NULLCOLS
       "TYPE_" INTEGER EXTERNAL,
       "DATE_MODIFY" "TO_DATE(:DATE_MODIFY, 'YYYYMMDDHH24MISS')",
       "ID_VEHICLE" INTEGER EXTERNAL,
       "I_TYPE_VEHICLE" INTEGER EXTERNAL,
       "ID_BRAND_VEHICLE" INTEGER EXTERNAL,
       "ID_MODEL_VEHICLE" INTEGER EXTERNAL,
       "ID_FUEL_TYPE" INTEGER EXTERNAL,
       "MODEL" CHAR,
       "I_COLOUR" INTEGER EXTERNAL,
       "METALIC" INTEGER EXTERNAL,
       "PLATE_NUMBER" CHAR,
       "MATRICULATION" "TO_DATE(:MATRICULATION, 'YYYYMMDDHH24MISS')",
       "VOCAL_STD_PASSWORD" CHAR,
       "VOCAL_EMR_PASSWORD" CHAR,
       "FRAME_NUMBER" CHAR,
       "ENGINE_NUMBER" CHAR,
       "NOTE" CHAR,
       "DATE_VALID_TO" "TO_DATE(:DATE_VALID_TO, 'YYYYMMDDHH24MISS')",
       "ID_USER_VALID_TO" INTEGER EXTERNAL
      )The problem is that I can fill just first table.
    The when clause of the second table always fails, and no rows are written.
    This is the log:
    Table "STG_ITALY"."STG_USER":
      68 Rows successfully loaded.
      0 Rows not loaded due to data errors.
      680 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.
    Table "STG_ITALY"."STG_VEHICLE":
      0 Rows successfully loaded.
      0 Rows not loaded due to data errors.
      748 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.What I'm doing wrong?
    Thanks in advance

    Try to modify your controlfile to
    OPTIONS ( DIRECT=FALSE,PARALLEL=TRUE, ERRORS=0, BINDSIZE=50000, ROWS=1000, READSIZE=65536)
    LOAD DATA
    CHARACTERSET UTF8
    TRUNCATE
    INTO TABLE "STG_ITALY"."STG_USER"
      WHEN TYPE_ = "1"
    FIELDS terminated by ',' enclosed by '"' TRAILING NULLCOLS
       "TYPE_" INTEGER EXTERNAL,
       "DATE_MODIFY" "TO_DATE(:DATE_MODIFY, 'YYYYMMDDHH24MISS')",
       "ID_USER" INTEGER EXTERNAL,
       "ID_USER_PARENT" INTEGER EXTERNAL,
       "I_TYPE_USER" INTEGER EXTERNAL,
       "COMPANY_NAME" CHAR,
       "FIRST_NAME" CHAR,
       "LAST_NAME" CHAR,
       "MIDDLE_NAME" CHAR,
       "I_NATIONALITY" INTEGER EXTERNAL,
       "LOGIN_NAME" CHAR,
       "LOGIN_PASSWORD" CHAR,
       "NOTE" CHAR,
       "DATE_VALID_TO" "TO_DATE(:DATE_VALID_TO, 'YYYYMMDDHH24MISS')",
       "ID_USER_VALID_TO" INTEGER EXTERNAL
    INTO TABLE "STG_ITALY"."STG_VEHICLE"
      WHEN TYPE_ = "2"
    FIELDS terminated by ',' enclosed by '"' TRAILING NULLCOLS
       "TYPE_" POSITION(1) INTEGER EXTERNAL,
       "DATE_MODIFY" "TO_DATE(:DATE_MODIFY, 'YYYYMMDDHH24MISS')",
       "ID_VEHICLE" INTEGER EXTERNAL,
       "I_TYPE_VEHICLE" INTEGER EXTERNAL,
       "ID_BRAND_VEHICLE" INTEGER EXTERNAL,
       "ID_MODEL_VEHICLE" INTEGER EXTERNAL,
       "ID_FUEL_TYPE" INTEGER EXTERNAL,
       "MODEL" CHAR,
       "I_COLOUR" INTEGER EXTERNAL,
       "METALIC" INTEGER EXTERNAL,
       "PLATE_NUMBER" CHAR,
       "MATRICULATION" "TO_DATE(:MATRICULATION, 'YYYYMMDDHH24MISS')",
       "VOCAL_STD_PASSWORD" CHAR,
       "VOCAL_EMR_PASSWORD" CHAR,
       "FRAME_NUMBER" CHAR,
       "ENGINE_NUMBER" CHAR,
       "NOTE" CHAR,
       "DATE_VALID_TO" "TO_DATE(:DATE_VALID_TO, 'YYYYMMDDHH24MISS')",
       "ID_USER_VALID_TO" INTEGER EXTERNAL
      )(only add a POSITION(1) keyword by the second table )
    Best regards
    Maxim

  • Regarding SQL Loader

    Hi,
    I have only one field to load my table. That is there is only 1 column in my table. My control file looks like this
    load data
    infile '/tmp/clo.list'
    --badfile 'temp_clo.bad'
    into table temp_clo
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    (clo)
    The fact is that my table is not getting loaded. In my input file I have a single value that has to be loaded. Please help me out.
    Thanks in advance

    Sample Log file:
    SQL*Loader: Release 9.2.0.1.0 - Production on Fri Jul 21 13:09:48 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Control File: C:\ONDEMAND_DEVELOPMENT\ond_lists.ctl
    Data File: C:\ONDEMAND_DEVELOPMENT\ac_nelson_f.txt
    Bad File: C:\ONDEMAND_DEVELOPMENT\ac_nelson_f.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 OND_LISTS, 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
    CHANGE_TYPE FIRST * ~ O(") CHARACTER
    CLASS_ID NEXT * ~ O(") CHARACTER
    LIST_ID NEXT * ~ O(") CHARACTER
    ITEM_ID NEXT * ~ O(") CHARACTER
    HIER_ID NEXT * ~ O(") CHARACTER
    PARENT_ITEM_ID NEXT * ~ O(") CHARACTER
    TEXT1 NEXT * ~ O(") CHARACTER
    NODE NEXT * ~ O(") CHARACTER
    SELECTABLE NEXT * ~ O(") CHARACTER
    CODE NEXT * ~ O(") CHARACTER
    DATATYPE NEXT * ~ O(") CHARACTER
    Table OND_LISTS:
    2714 Rows 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: 181632 bytes(64 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 2714
    Total logical records rejected: 0
    Total logical records discarded: 0
    Run began on Fri Jul 21 13:09:48 2006
    Run ended on Fri Jul 21 13:09:54 2006
    Elapsed time was: 00:00:05.67
    CPU time was: 00:00:00.14

  • SQL*Loader and CONTINUEIF clause

    Hi,
    I used SQL*Loader to load in a table some files coming from main frame environnement.
    The length of the physical record is 1662 characters. For some lines of the file, the characters CR (X'0C') could appear anywhere in the position 1158 to 1165 inclusively. I just want to know how to tell to SQL*Loader to concatenate the next record by using CONTINUEIF clause.
    I made a simple test. I checked only the position 1165 and it works. Here is the "ctl":
    OPTIONS (ERRORS=999999)
    LOAD DATA
    infile 'T:\RéalDelisle\AGR.PBC1.SCOPY001.de test avec x25 aux positions 1158 a  1165.txt'
    BADFILE 'D:\Sinpac\Bad\sinpac_YT.bad'
    DISCARDFILE 'D:\Sinpac\Disc\sinpac_YT.dsc'
    APPEND
    CONTINUEIF THIS PRESERVE (1165)=X'0C'
    INTO TABLE AGRMDHD1.Sinpac_YT
    +(+
    CODEFICHIER             constant  "D501.A0405",
    C001_CP12               position (1:12) ,
    C001_record             position (1:1662),
    C001_record_1157        position (1:1157),
    C001_record_1166        position (1166:1662),
    +          C001_Mont_subv_adm position (1644:1652) "TO_NUMBER(:c001_mont_subv_adm,'999999D99', 'NLS_NUMERIC_CHARACTERS = ''. '' ')",+
    C001_Mont_subv_adm_nouv position (1654:1662) "TO_NUMBER(:c001_mont_subv_adm_nouv,'999999D99', 'NLS_NUMERIC_CHARACTERS = ''. '' ')"
    +)+
    But, I want to do the test for the position 1158 to 1165 (the character X'0C' could appear in one of those positions). I tried this but it didn't work (I've got a syntax error):
    OPTIONS (ERRORS=999999)
    LOAD DATA
    infile 'T:\RéalDelisle\AGR.PBC1.SCOPY001.de test avec x25 aux positions 1158 a  1165.txt'
    BADFILE 'D:\Sinpac\Bad\sinpac_YT.bad'
    DISCARDFILE 'D:\Sinpac\Disc\sinpac_YT.dsc'
    APPEND
    CONTINUEIF THIS PRESERVE (1158)=X'0C'
    CONTINUEIF THIS PRESERVE (1150)=X'0C'
    CONTINUEIF THIS PRESERVE (1160)=X'0C'
    CONTINUEIF THIS PRESERVE (1161)=X'0C'
    CONTINUEIF THIS PRESERVE (1162)=X'0C'
    CONTINUEIF THIS PRESERVE (1163)=X'0C'
    CONTINUEIF THIS PRESERVE (1164)=X'0C'
    CONTINUEIF THIS PRESERVE (1165)=X'0C'
    INTO TABLE AGRMDHD1.Sinpac_YT
    +(+
    CODEFICHIER             constant  "D501.A0405",
    C001_CP12               position (1:12) ,
    C001_record             position (1:1662),
    C001_record_1157        position (1:1157),
    C001_record_1166        position (1166:1662),
    +          C001_Mont_subv_adm position (1644:1652) "TO_NUMBER(:c001_mont_subv_adm,'999999D99', 'NLS_NUMERIC_CHARACTERS = ''. '' ')",+
    C001_Mont_subv_adm_nouv position (1654:1662) "TO_NUMBER(:c001_mont_subv_adm_nouv,'999999D99', 'NLS_NUMERIC_CHARACTERS = ''. '' ')"
    +)+
    I looked in the documentation but I found nothing about the way to do it.
    Does anybody have an idea?
    Thank's

    If a record contains CR (X'0C'), then is the CR (X'0C') always the last character of the record? If so, I think you'd use LAST (it's all in the Docs.).
    If not, then I don't think SQL*Loader will do what you want. Instead, I think you'd need to manipulate the data before it reaches SQL*Loader. You use Windows, so what about installing CygWin? It's a winner, really, and you can then do lovely sed,vi & awk stuff on your data - and it's very fast, too.
    Regards - Don Lewis

  • SQL LOADER Problem when data is loaded but not come in standard formate

    Hi guys,
    I got problem when sql loader run data loaded successfully in table but UOM data not come in standard formate.
    UOM table column contains the Unit of measure data but in my excel sheet it's look like :
    EXCEl SHEET DATA:
    1541GAFB07080          0     Metres
    1541GAFE10040          109.6     Metres
    1541GAFE10050          594.2     Metres
    1541GAFE10070          126.26     Metres
    1541GAFE14040          6.12     Metres
    1541GAFE14050          0     Metres
    1541SAFA05210          0     Metres
    1541SAFA07100          0     Metres
    1551EKDA05210          0     Nos
    1551EKDA07100          0     Nos
    1551EKDA07120          0     Nos
    1551EKDA07140          0     Nos
    1551EKDA07200          0     Nos.
    1551EKDA08160          0     Nos.
    1551EKDA08180          0     Nos.
    1551EKDA08200          0     Nos.
    1551EKDA10080          41     Nos.
    1551EKDA10140          85     Nos.
    .ctl file :
    OPTIONS (silent=(header,feedback,discards))
    LOAD DATA
    INFILE *
    APPEND
    INTO TABLE XXPL_PO_REQUISITION_STG
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY'"'
    TRAILING NULLCOLS
    ( ITEM_CODE CHAR,
    ITEM_DESCRIPTION CHAR "TRIM(:ITEM_DESCRIPTION)",
    QUANTITY,
    UOM,
    NEED_BY_DATE,
    PROJECT,
    TASK_NAME,
    BUYER,
    REQ_TYPE,
    STATUS,
    ORGANIZATION_CODE,
    LOCATION,
    SUBINVENTORY,
    LINE_NO,
    REQ_NUMBER,
    LOADED_FLAG CONSTANT 'N',
    SERIAL_NO "XXPL_PRREQ_SEQ.NEXTVAL",
    CREATED_BY,
    CREATION_DATE SYSDATE,
    LAST_UPDATED_BY,
    LAST_UPDATED_DATE,
    LAST_UPDATED_LOGIN
    Some output came in table like:
    W541WDCA05260 0 Metres|
    W541WDCA05290 3 Metres|
    W541WDCA05264 4 Metres|
    W541WDCA05280 8 Metres|
    1551EADA04240 0 Nos|
    1551EADA07100 0 Nos|
    1551EKDA10080 0 Nos.|
    1551EKDA10080 41 Nos.|
    proble in | delimiter...how to remove it ' | ' from my table when sqlloader program runnig ...... where i can change in .ctl file or excel file....it's urgent guys olz help me ..
    thanks

    Hi,
    How are you extracting the data to Excel sheet ?
    Please check the format type of the column in Excel sheet for UOM.
    There is no issue in the SQL loader control file, but issue is there in your source excel file. (Try using a different method to extract the data to Excel sheet.)
    Regards,
    Yuvaraj.C

  • Regarding sql loader ---  can we have  control file  to do a check on csv?

    Hi,
    I normally get a csv having data as
    column1 ;columnb;columnc;
    13 ; 12 ; 13 ;
    11 ;13 ;33;
    as the table where it needs to go is say table
    xys( a number, b number , c number).
    so the control file is fairly simple ...
    But from now I need to restrict data entry if the change in format happens in the csv
    say if it is like
    column2;column1;column3,
    12,13;12;
    11;13;14;
    or say the csv like
    column1;column2;column3;column4;
    11;13;14;15;
    111;134;14;12;
    in both cases sql loader should not run and throw the error saying the reason in the log.
    how do i manage it in the control file `???
    any ideas???
    it is urgent pls help !!!
    regards
    SHUBH
    Message was edited by:
    SHUBH

    Try changing the following properties:
    autosubmit = true;
    immediate = true;
    Here is a link where the user uses a transient attribute for the rows in his table:
    Technology on my way...:): ADF 11g : CheckBox Demo (Select one checkbox in table, Select all/Deselect all)
    Hope that helps.
    Regards,
    Frederico.

  • SQL Loader ISSUE- when invoking function in a package - in Direct Path- SPK

    This is the loader file a.ctl
    load data
    append
    into table emp
    when eno='4'
    (eno number,
    ename varchar2(20))
    when (1)<>'4'
    into table detpt
    (deptno number,
    deplogid "Log.get_logid('logid')"
    Note: the deptlogid field is not null column.
    The par fie is as follows
    rows=1000
    errors=0
    direct=true
    control=a.ctl
    when i am running this file i am getting error when i am invoking the package Log.get_logid('logid')" in direct mode. It returns null value when it is used in control file.
    1) if i am running this function in sql prompt like
    select Log.get_logid('logid') from dual
    i am getting result as 121.
    2) what is the problem when the same function is used in Sql loader in direct mode.
    3) is there any restriction to use the function in sql loader?
    4) whether to use the function in sql loader is applicable for direct mode or conventional mode.
    5) when i am running in conventional mode it is working fine . what is the reason??
    I am running the loader from dos prompt like
    c:> sqlldr scott/tiger@dev parfile=abc.par
    Oracle 9i is the version for the loader.
    Please help me out to solve the issue

    This is the loader file a.ctl
    load data
    append
    into table emp
    when eno='4'
    (eno number,
    ename varchar2(20))
    when (1)<>'4'
    into table detpt
    (deptno number,
    deplogid "Log.get_logid('logid')"
    Note: the deptlogid field is not null column.
    The par fie is as follows
    rows=1000
    errors=0
    direct=true
    control=a.ctl
    when i am running this file i am getting error when i am invoking the package Log.get_logid('logid')" in direct mode. It returns null value when it is used in control file.
    1) if i am running this function in sql prompt like
    select Log.get_logid('logid') from dual
    i am getting result as 121.
    2) what is the problem when the same function is used in Sql loader in direct mode.
    3) is there any restriction to use the function in sql loader?
    4) whether to use the function in sql loader is applicable for direct mode or conventional mode.
    5) when i am running in conventional mode it is working fine . what is the reason??
    I am running the loader from dos prompt like
    c:> sqlldr scott/tiger@dev parfile=abc.par
    Oracle 9i is the version for the loader.
    Please help me out to solve the issue

  • Need help regarding sql loader

    Hi ,
    I am executing following command
    sqlldr admin_user@ces CONTROL=D:\sample_control.ctl log=D:\sample_log.log bad=D:\Sample_bad.bad
    In case of valid data it is inserting the data properly into the table. While invalid records added into the bad file.
    Now I want rollback valid data whenever count of bad file greater than equal to 10.
    In short whenever file has more than 10 invalid records , I don't want to insert any record from that file.
    Please provide me the solution.Thanks in advance.

    SQL*Loader Command-Line Reference
    DISCARDMAX(integer)
    Regards
    Etbin

  • Help Needed regarding SQL Loader Error

    Hi,
    I am trying to insert some records into two tables using same control file.
    I am using the follwing command to load data
    sqlload "$ORAUSER" CONTROL="$LDRFILE" DATA="$DATA_PATH/$DATA_FILE" BAD="$BAD_FILE" LOG="$LOG_FILE" DISCARD="$DISCARD_FILE" ERRORS="$MAX_ERRS"
    I am getting the error: SQL-LOADER - 350: Illegal combination of non-alphanumeric characters
    #!/bin/ksh
    Please suggest me what I need to do.
    Thanks,
    Srinivas.

    it appears that you are using this line code in your korn shell script. if you try to do a manual run on the unix command line do you still get the same error?
    also can you post a sample value for all the parameters you have.

  • SQL Load ORDER BY clause

    Does anyone know how or where to enter the ORDER BY clause when using a SQL data source in a load rule? I would prefer to do the ordering in the load rule rather than creating a view on the DB side to do this if at all possible.
    According to the documentation "The SQL Statement box in the Open SQL Data Sources dialog box provides Select, From, and Where text boxes that help you write SQL queries. You can specify multiple data sources, filter the display of records, and specify how records displayed in Data Prep Editor are ordered and grouped." but I haven't found anywhere where you can order or group data. I don't need to be able group data I just want to be able to order my data to make the load process as efficient as possible.
    I do sort the data when inserting it into the load table but Oracle doesn't necessarily insert the records into the table based on their order when going in.
    We are currently on Essbase 11.1.1.3 and Oracle 11g.
    Any help is greatly apprecied.

    Well DUH! Everyone knows that! :-)
    Not sure why I never tried that, but it works. They need to update the documentation to say this, but we all know that will never happen.
    Thanks again!

  • SQL Loader / WHEN clause / swich off? / bloated log files

    Hallo everyone,
    I am loading data from very large source files using SQL-Loader. This all works fine.
    However, now, using the WHEN clause (in the control file), I would like to load only a very restricted sub-set of the main data. This also works fine ...
    WHEN ARTICLECODE != '000000000000006769'
    However, the log file becomes completely bloated with messages telling me of each record which has failed the WHEN clause ...
    Record 55078: Discarded - failed all WHEN clauses.
    This is becoming a problem because it slows down the process and creates bloated log files which are eating up my disk-space.
    There must be a simple command to allow me to switch off thiese messages but, although I have googled on it, I haven't managed to find it.
    Any ideas on this one? I'm sure it's simple.
    Regards and many thanks,
    Alan Searle

    Try to add key SILENT=DISCARDS to sqlldr command
    Silent means - Suppress messages during run (header,feedback,errors,discards,partitions)

  • Importing to a Oracle Table from SQL Loader Fails

    Hi ,
    When I try to upload one xml file from my server to my table in oracle server using sql loader it fails at times.Some times it works perfectly.
    This is a daily process which automatically dumps data to my oracle.
    Please find the error log :
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Dec 5 04:07:32 2013
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Control File:   xmlFeedDelta.ctl
    Data File:      xmlFileNames_Delta.txt
      Bad File:     xmlFileNames_Delta.bad
      Discard File:  none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 1000
    Bind array:     50000 rows, maximum of 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    Table XMLFEEDDELTA, loaded from every logical record.
    Insert option in effect for this table: APPEND
       Column Name                  Position   Len  Term Encl Datatype
    FILENAME                            FIRST  4000   ,       CHARACTER           
    FILECONTENT                       DERIVED     *  EOF      CHARACTER           
        Dynamic LOBFILE.  Filename in field FILENAME
    value used for ROWS parameter changed from 50000 to 63
    SQL*Loader-643: error executing INSERT statement for table XMLFEEDDELTA
    ORA-03113: end-of-file on communication channel
    SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.
    Table XMLFEEDDELTA:
      0 Rows 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:                 252378 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 Thu Dec 05 04:07:32 2013
    Run ended on Thu Dec 05 04:08:42 2013
    Elapsed time was:     00:01:10.05
    CPU time was:         00:00:00.28
    My Control File Looks like this :
    LOAD DATA
    INFILE xmlFileNames_Delta.txt
    INTO TABLE xmlFeedDelta APPEND
    fields terminated by ','
    filename CHAR(4000),
    filecontent LOBFILE(filename) terminated by eof
    My Database version :
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production"
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    I am not sure why this is happening at times . Any help would be appreciated.

    Hi,
    have you tried with the FILLER  command like
    LOAD DATA
    INFILE xmlFileNames_Delta.txt
    INTO TABLE xmlFeedDelta APPEND
    fields terminated by ','
    filename  FILLER CHAR(4000),
    filecontent LOBFILE(filename) terminated by eof

  • Sql loader fail to load

    Hi,
    i'm getting a very strange issue with sql loader. i want expert advice how to look into this matter and solve this problem. our application use sql loader to load text file into table. but sometime it reject the record and mark it bad. although those records are not actually bad. when i load them again it loaded without any error. . why sql loader reject them in first load and load successfully in next turn with same control file and data . anybody guide me how to investigate this issue. when sql loader rejects the row it through the error in log file
    Record 23894: Rejected - Error on table GN_FILE_DATA_TABLE.
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01861: literal does not match format string
    Table GN_FILE_DATA_TABLE:
      53009 Rows successfully loaded.
      41827 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.
    Bind array size not used in direct path.
    Column array  rows :    5000
    Stream buffer bytes:  256000
    Read   buffer bytes: 1048576
    Total logical records skipped:          1
    Total logical records read:         94836
    Total logical records rejected:     41827
    Total logical records discarded:        0
    Total stream buffers loaded by SQL*Loader main thread:    41867
    Total stream buffers loaded by SQL*Loader load thread:      195
    Run began on Tue May 29 04:30:30 2012
    Run ended on Tue May 29 04:31:14 2012
    Elapsed time was:     00:00:44.34
    CPU time was:         00:00:07.27whereas same bad records file load without any error in next load.
    im using oracle version is 11g r2 and os is win 2008 server,loading data from remote server.
    any idea?

    It is very difficult to resolve a problem which can not be seen.it is true becoz i did not get any error
    To get 'expert advice' you would need to do what you could have done yourself:i have spend almost 5 five hour before putting question here
    compare and/or post the sql*loader control file (which we are not to see)i have mentioned in my post that i used same control file for both. bu jsut changing the name of input file in control file
    and to look up the error message onlinecould you plz let me know which error should i look for online?
    what i did before putting question here. i have merge the both bad and loaded file again and load it separately. both load remain successful.

  • SQL Loader choosing conventional path when direct path is requested

    We have a mystery regarding SQL Loader choosing to load with conventional path even though direct path is requested.
    We have a control file that produces direct-path loads and one which does not. The difference between them does not seem to account for the difference in behavior.
    The following control file does not give us direct-path:
    OPTIONS (
         SKIP=0,
         ERRORS=0,          
         DIRECT=TRUE,          
         NOLOGGING
    LOAD DATA
    INFILE "[file path]" "STR x'0A'"
    BADFILE "[file path].bad"
    DISCARDFILE "[file path].dsc"
    DISCARDMAX 0
    INSERT
    INTO [schema name].[table name]
    FIELDS TERMINATED BY X'2C'
    OPTIONALLY ENCLOSED BY '?'
    TRAILING NULLCOLS
         C1_ACD_LINE_CD     CHAR(2000),
    [column specifications continue]
    )When running with this control file, the log shows:
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 0
    Bind array:     64 rows, maximum of 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    Table [schema name].[table name], loaded from every logical record.
    Insert option in effect for this table: INSERT
    TRAILING NULLCOLS option in effectIf we use a control file that is modified as follows:
    OPTIONS (
         SKIP=0,
         ERRORS=0,     
         DIRECT=TRUE,     
         PARALLEL=TRUE,
         NOLOGGING
         )Then we do get direct-path load:
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 0
    Continuation:    none specified
    Path used:      Direct
    Table [schema name].[table name], loaded from every logical record.
    Insert option in effect for this table: INSERT
    TRAILING NULLCOLS option in effectSo there is nothing about the table (constraints, triggers, etc.) that is preventing direct-path loads.
    Now, we stumbled into this PARALLEL thing by accident - we are not really trying to do parallel loads.
    In my reading of the Utilities guide (http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_modes.htm#autoId64 ), the PARALLEL option lets SQL Loader tolerate multiple sessions loading to the same segment at once, but does not perform parallel processing itself. So, is it possible there is some other lock on the table is causing SQL Loader to block direct-path loads to the table (because of a previous SQL Loader direct-path load, perhaps) unless the PARALLEL option is invoked? If so, how do we recognize that state and how do we resolve it?
    Version information:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE     11.2.0.3.0     Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    Any thoughts or suggestions would be appreciated.
    Thanks,
    Mike

    From the same link
    >
    To use a direct path load (except for parallel loads), SQL*Loader must have exclusive write access to the table and exclusive read/write access to any indexes.
    >
    So I suspect that when using only DIRECT=TRUE, Oracle is not able to get an exclusive lock on the required objects, so it uses the conventional mode.
    From a later section
    >
    - Segments to be loaded do not have any active transactions pending.
    To check for this condition, use the Oracle Enterprise Manager command MONITOR TABLE to find the object ID for the tables you want to load. Then use the command MONITOR LOCK to see if there are any locks on the tables.
    >
    Would be interested in knowing what you find
    HTH
    Srini

Maybe you are looking for

  • Error in generating pdf :(:(:(

    Post Author: carola CA Forum: Desktop Intelligence Reporting Hello all, I've had an application in vs 2005 that calls business object 6.5 app to generate pdf reports. This works perfectly on a machine with: Windows 2000 server, framework 2.0. But now

  • Got an iPhone 4 and after updating to iOS 6 my wifi is dropping off constantly and can no longer send pics on iMessage any help?

    I am so done with this crappy updating, first it was that I could no longer keep on my wifi for more than a few minutes coz it cuts off continuously and now I can no longer send pics with my iMessage. Going to switch to another brand. It's overpriced

  • My Macbook Pro either won't boot or would crash a few mins after booting

    Hi everyone, I'm having some problems with my Macbook Pro with Mac OS X 10.6.8 here. It all started when I was just browsing the internet normally (with spotify web player on, if that's of any use) and a screen of black and white stripes appeared. I

  • Security in my web.xml in Tomcat 4

    Hello, I was using this application on Tomcat 3 and my web.xml worked perfectly well. However when I tried to start it on Tomcat 4 there is something wrong with the security part of my web.xml . If I leave out the security constraint for this applica

  • Installing iWeb 2.0.2 is the worst nightmare ever

    When I first instal iWeb 2.0.1, all was wrong but one day started working, this was until the patch of iWeb 2.0.2 when again everything was wrong again, I do like a lot iWeb and I have a lot on my .mac account I even have 20GB of hard disk in my subs