SQL*Loader-418: Bad datafile datatype for column XMLDOC

Hi,
I am trying to load a xml document into a xmltype column in a table using SQL*Loader and I receive this error:
SQL*Loader-418: Bad datafile datatype for column XMLDOC
My ctl is:
LOAD DATA INFILE 'marginalpdbc_xml_20030529.xml'
APPEND INTO TABLE PRUEBA_CARGA
( XMLDOC LOBFILE (CONSTANT 'marginalpdbc_xml_20030529.xml')
TERMINATED BY EOF,
NOMBFICH CONSTANT 'marginalpdbc_xml_20030529.xml' )
And the table is:
create table prueba_carga (NOMBFICH VARCHAR2(200),xmldoc xmltype);
What is wrong with my ctl?
I am using SQL*Loader: Release 9.2.0.1.0 and Oracle9i Enterprise Edition Release 9.2.0.1.0
Thanks in advance.

Looks like there is data which takes > 8 digits for the 'DTE_ADDED' column.
Plz check that first.
Can you provide a couple of lines of data for sampling ???

Similar Messages

  • Sql Loader - Decimal numbers showing in null column

    Greetings,
    My apologies if this is in the wrong forum section. It seemed to be the most logical.
    I have added new column to a control file used in a sql loader upload and I am getting unexpected results. Long story short, I copy foxpro tables from a network directory to my local pc. A foxpro exe converts these tables to .dat files. Sql loader then uploads the .dat files to matching oracle tables. I've run this program from my pc for years with no problems.
    Problem now: We added a new column to a foxpro table and to the matching oracle table. This column in FoxPro in null for now - no data at all. I then added the new column to my ctl file for this table. The program runs, sql loader does it's thing with no errors. However, in the new field in Oracle, I'm finding decimal numbers in many of the records, when all records should have null values in this field. I've checked all other columns in the oracle table and the data looks accurate. I'm not sure why I'm getting these decimal values in the new column.
    My log and bad files show no hints of any problems. The bad file is empty for this table.
    At first I thought the positioning of the new column in the fox table, .ctl file and the oracle table were not lining up correctly, but I checked and they are.
    I've double checked the FoxPro table and all records for this new column are null.
    I'm not sure what to check for next or what to test. I am hoping someone in this forum might lend a clue or has maybe seen this problem before. Below is my control file. The new column is the last one: fromweb_id. It is a number field in both FoxPro and Oracle.
    Thanks for any advise.
    JOBS table control file:
    load data
    infile 'convdata\fp_ora\JOBS.dat' "str X'08'"
    into table JOBS
    fields terminated by X'07'
    TRAILING NULLCOLS
    (SID,
    CO_NAME "replace(replace(:CO_NAME,chr(11),chr(10)),chr(15),chr(13))",
    JOB_TITLE "replace(replace(:JOB_TITLE,chr(11),chr(10)),chr(15),chr(13))",
    CREDITS,
    EARN_DATE date "mm/dd/yyyy",
    COMMENTS CHAR(2000) "replace(replace(:COMMENTS,chr(11),chr(10)),chr(15),chr(13))",
    DONT_SHOW,
    PC_SRC "replace(replace(:PC_SRC,chr(11),chr(10)),chr(15),chr(13))",
    PC_SRC_NO,
    SALARY,
    SALFOR,
    ROOM,
    BOARD,
    TIPS,
    UPD_DATE date "mm/dd/yyyy hh12:mi:ss am",
    STUKEY,
    JOBKEY,
    JO_COKEY,
    JO_CNKEY,
    JO_ZUKEY,
    EMPLID,
    CN_NAME "replace(replace(:CN_NAME,chr(11),chr(10)),chr(15),chr(13))",
    JOB_START date "mm/dd/yyyy",
    JOB_END date "mm/dd/yyyy",
    FROMWEB_ID)

    I apologize for not explaining how this was resolved. Sql Loader was working as it should.
    The problem was due to new fields being added to the FoxPro table, along with the fromweb_id column, that I was not informed about. I was asked to add a column named fromweb_id to the oracle jobs table and to the sql-loader program. I was not told that there were other columns added at the same time. In the foxpro table, the fromweb_id column was the last column added.
    The jobs.dat file contained data from all columns in the foxpro table, including all the new columns. I only added the "fromweb_id" to the control file, which is what I was asked to do. When it ran, it was getting values from one of the new columns and the values were being uploaded into the fromweb_id column in Oracle. It is that simple.
    When I had checked the FoxPro table earlier, I did not pickup on the other new columns. I was focussing in on looking for values in the fromweb_id column. When back-tracing data in the jobs.dat file, I found a value in the fromweb_id column that matched a value in a differnt column (new column) in FoxPro. That is when I realized the other new columns. I instantly knew what the problem was.
    Thanks for all the feedback. I'm sorry if this was an inconvenience to anyone. I'll try to dig a little deeper next time. Lessons learned...
    regards,

  • Sql Loader INFILE name value in table column Value

    Hi,
    Here is my Sql Loader Script
    LOAD DATA
    infile '%1'
    APPEND INTO TABLE XX_SUPPLIER_UPD
    FIELDS TERMINATED BY ";" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
    ACTION Char
    ,ADDRESS_TYPE Char
    ,REGION Char "LTRIM(RTRIM(:REGION))"
    ,PO_BOX Char
    ,,WWW_ADDRESS Char
    ,status Char "NVL(:status,'X')"
    ,filename Char "replace(:infile,'\"','')"
    I am getting the infile name as the parameter and i want to insert that parameter value in the column name fillename. Can any one guide me to how to do.
    Cheers!
    Jayaraj.S

    If you were to use external tables instead of SQL*Loader, you can dynamically change the location of the external table (i.e. the filename) using a simple ALTER TABLE statement.
    External tables also mean that all the control is inside the database rather than relying on external utilities and external scripts.
    ;)

  • SQL Loader and control file changes for different users

    In the front end of my application I can select a data file and a control file, and load data to the table mentioned in .ctl file. Every user who logs in uses the same .ctl file and so loads onto the same table. Now I want the user to load data onto the table in his own schema. I can get the username of the user currently logged in and i want to insert it into that username.table. So can i copy the contents of the .ctl file into a variable, modify it into username.table in that string and pass that variable as a parameter to the sqlldr command instead of the .ctl file.
    Or is there a better way how I can modify the same control file everytime to change tablename to username.tablename in .ctl file and pass to sqlldr to load data to table in local user schema table.
    Thanks and Regards

    Thanks for the reply .. user do have their user credentials but only for the application ... but all users use a common loader and control file once they log into the application. So irrespective of which user is logged in he selects the same control file and loads to the same table mentioned in the control file .. i instead want user to be able to load to the table in control file but into his schema like username.tablename instead of just the tablename mentioned in .ctl file.

  • SQL*LOADER example not working for REF

    I was working on the Oracle bulk load scripts using SQL*LOADER utility .
    I have encountered an error while using the REF column option to resolve the parent-child referential integrity .
    The example given in the URL http://www.csee.umbc.edu/help/oracle8/server.815/a67792/ch05.htm Example 5-9 Loading Primary Key REF Columns
    does not work . and generates errors : 'SQL*Loader-418: Bad datafile datatype for column DEPT_MGR'
    example :
    Control File
    LOAD DATA
    INFILE `sample.dat'
    INTO TABLE departments_alt
    FIELDS TERMINATED BY `,' OPTIONALLY ENCLOSED BY `"'
    (dept_no CHAR(5),
    dept_name CHAR(30),
    dept_mgr REF(CONSTANT `EMPLOYEES', emp_id),
    emp_id FILLER CHAR(32))
    Data file (sample.dat)
    22345, QuestWorld, 007,
    23423, Geography, 000,
    Could you please suggest any solutions for this ?

    Some of the quotes are wrong
    Try the sample from the 10.2 documentation
    LOAD DATA
    INFILE 'sample.dat'
    INTO TABLE departments_alt
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (dept_no       CHAR(5),
    dept_name      CHAR(30),
    dept_mgr       REF(CONSTANT 'EMPLOYEES', emp_id),
    emp_id         FILLER CHAR(32))

  • SQL*Loader: How to use Sequence and REF together?

    Hi,
    I'm getting the following error:
    SQL*Loader-418: Bad datafile datatype for column AREA_ID.
    I attempt to upload one datafile into 4 different tables.
    When executing sqlldr scott/tiger control=sqlldr_aj_new.ctl
    1) Here is my Control file (sqlldr_aj_new.ctl):
    load data
    infile 'TST_MAIN_NEW.csv'
    -- Loads table "TST_AREAS"
    into table TST_AREAS
    REPLACE
    FIELDS TERMINATED by ','
    (AREA_ID SEQUENCE,
    AREA_NAME,
    PRODUCT_ID,
    PRIORITY_ID,
    PLAN_ID,
    CREATED_BY_ID,
    AREA_DESC)
    -- Loads table "TST_TEMPLATE_SCENS"
    into table TST_TEMPLATE_SCENS
    REPLACE
    FIELDS TERMINATED by ','
    (TEMPLATE_SCEN_ID SEQUENCE,
    SCENARIO_NAME,
    MODIFIED_BY_ID,
    SCEN_TYPE_ID,
    OWNER_ID,
    PRIORITY_ID,
    SCOPE_ID,
    SCENARIO_DESC,
    AREA_ID REF(CONSTANT 'TST_AREAS', AREA_ID))
    2) Here is my data file(TST_MAIN_NEW.csv)
    B/S,105,1,plan_id_1,2222,area_desc1,CCEMC_PR_001,1111,1,2222,2,1,scenario_desc_1
    B/S,105,1,plan_id_2,2222,area_desc2,CCEMC_PR_002,1111,2,2222,2,2,scenario_desc_2
    3) Here are the tables:
    TST_AREAS
    Name Null? Type
    AREA_ID NOT NULL NUMBER(35)
    AREA_NAME CHAR(64)
    PRODUCT_ID NUMBER(35)
    PRIORITY_ID NUMBER(35)
    PLAN_ID NUMBER(35)
    CREATED_BY_ID NUMBER(35)
    AREA_DESC CHAR(1000)
    TST_TEMPLATE_SCENS
    Name Null? Type
    TEMPLATE_SCEN_ID NOT NULL NUMBER(35)
    SCENARIO_NAME CHAR(500)
    MODIFIED_BY_ID NUMBER(35)
    SCEN_TYPE_ID NUMBER(35)
    OWNER_ID NUMBER(35)
    PRIORITY_ID NUMBER(35)
    SCOPE_ID NUMBER(35)
    SCENARIO_DESC CHAR(1000)
    AREA_ID NOT NULL NUMBER(35)
    Please advise what is the reason for an error.
    Thank you very much!
    Andrey

    I don't think so.
    SQL> create table t (
      2  rowid number);
    rowid number)
    ERROR at line 2:
    ORA-00904: : invalid identifierPlease post your version number and the DDL for the table.
    Best practice in Oracle is to NEVER, EVER, store a ROWID: They can change.
    After you have solved the first problem, that you've never actually built the table, the solution to the sequence use is to make the call in your DML.
    INSERT INTO t (testcol) VALUES (<sequence_name>.NEXTVAL);

  • Sql loader: loading external file into blob

    hi,
    i keep being blocked by loading external binary files into a blob columns with sql loader tool.
    Here is the problem:
    I want to load pictures into a table with lob columns. Here is my control file, data file and the error message:
    control file:
    LOAD DATA
    APPEND
    INTO TABLE T_K58_SYMBOLE
    FIELDS TERMINATED BY ';' TRAILING NULLCOLS
    SYMB_ID INTEGER EXTERNAL(8),
    SYMB_LMLABEL CHAR(100),
    imgName FILLER,
    SYMB_GIF_HI BFILE(CONSTANT ".", imgName),
    thumbName FILLER,
    SYMB_GIF_LOW BFILE(CONSTANT ".", thumbName)
    data file:
    1;0800;image1.gif;image1.gif;
    error message:
    SQL*Loader-418: Bad datafile datatype for column SYMB_GIF_HI
    Here is the script of the creation of my table in my database:
    create table T_K58_SYMBOLE (
    SYMB_ID NUMBER(8) not null,
    SYMB_LMLABEL VARCHAR2(100),
    SYMB_GIF_HI BLOB,
    SYMB_GIF_LOW BLOB,
    constraint PK_T_K58_SYMBOLE primary key (SYMB_ID)
    LOB (SYMB_GIF_HI, SYMB_GIF_LOW) STORE AS (tablespace TDK5813)
    tablespace TDK5811
    Please, i need help!!!!

    This is my control file. I'm loading images in database table using sqlldr in Unix:
    LOAD DATA
    INFILE 'sampledata.dat'
    INTO TABLE image_table
    APPEND
    FIELDS TERMINATED BY ',' optionally enclosed by '"'
    IMAGE_ID INTEGER EXTERNAL,
    FILE_NAME CHAR,
    IMAGE_DATA LOBFILE(FILE_NAME) TERMINATED BY EOF
    I'm facing following error:
    SQL*Loader-350: Syntax error at line 9.
    Expecting "," or ")", found "LOBFILE".
    IMAGE_DATA LOBFILE(FILE_NAME) TERMINATED BY EOF
    My data file is:
    1,"IMG_3126.jpg"
    2,"IMG_3127.jpg"
    3,"IMG_3128.jpg"
    and images are in the same server. please help me to get out of this.
    Thanks,
    Surjeet Kaur

  • Is license required for Sql Loader?

    I find that Sql Loader could save much time for me in bulk inserting.
    But I'm not sure whether license is required for using it in business software developing.
    Or is there any API that can provide similar functionality of Sql Loader?

    The sqlldr utility, expdp and impdp, and sqlplus come with the rdbms license. Earlier client software had the option of installing sqlldr, exp, and imp onto the client machine for use against a remote database. Being that expdp and impdp only run on the database server now these two utilities are probably not included but sqlldr may still be available as part of the client.
    HTH -- Mark D Powell --

  • Problem in Data Migration via. SQL*Loader

    Hi,
    I am trying to load the data from a text generated file.
    While using the slqldr command along with the url,".ctl", ".log",".bad" and ".dat" parameters, all the records goes to ".bad" file. Why?
    Eventhouh it parse the control file successfully.
    Anybody please help me in the matter.
    I am sending the ".log" file generated during the transaction :
    ========================================================================
    Control File: CUSTOMER.CTL
    Data File: CUSTOMER.DAT
    Bad File: CUSTOMER.BAD
    (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 CUSTOMER_BACKUP, loaded from every logical record.
    Insert option in effect for this table: INSERT
    Column Name Position Len Term Encl Datatype
    CS_CODE FIRST * WHT O(") CHARACTER
    CS_NAME NEXT * WHT O(") CHARACTER
    CS_ADD1 NEXT * WHT O(") CHARACTER
    CS_ADD2 NEXT * WHT O(") CHARACTER
    CS_ADD3 NEXT * WHT O(") CHARACTER
    CS_ADD4 NEXT * WHT O(") CHARACTER
    CS_PIN NEXT * WHT O(") CHARACTER
    CS_PHONE NEXT * WHT O(") CHARACTER
    CS_TELEX NEXT * WHT O(") CHARACTER
    CS_CR_DAYS NEXT * WHT O(") CHARACTER
    CS_CR_LIM NEXT * WHT O(") CHARACTER
    CS_TRD_DIS NEXT * WHT O(") CHARACTER
    CS_CSH_DIS NEXT * WHT O(") CHARACTER
    CS_STX_FRM NEXT * WHT O(") CHARACTER
    CS_LSTX_NO NEXT * WHT O(") CHARACTER
    CS_MOB_BAL NEXT * WHT O(") CHARACTER
    CS_STX_PER NEXT * WHT O(") CHARACTER
    CS_IND NEXT * WHT O(") CHARACTER
    CS_CSTX_NO NEXT * WHT O(") CHARACTER
    CS_SLMN_CD NEXT * WHT O(") CHARACTER
    CS_BANK_1 NEXT * WHT O(") CHARACTER
    CS_BANK_2 NEXT * WHT O(") CHARACTER
    CS_BANK_3 NEXT * WHT O(") CHARACTER
    CS_YOB_BAL NEXT * WHT O(") CHARACTER
    CS_CURR NEXT * WHT O(") CHARACTER
    CS_ZONE NEXT * WHT O(") CHARACTER
    CS_CAT NEXT * WHT O(") CHARACTER
    F_EDT NEXT * WHT O(") CHARACTER
    F_UID NEXT * WHT O(") CHARACTER
    F_ACTV NEXT * WHT O(") CHARACTER
    CS_RANGE NEXT * WHT O(") CHARACTER
    CS_ITNO NEXT * WHT O(") CHARACTER
    CS_INT NEXT * WHT O(") CHARACTER
    CS_CIRCLE NEXT * WHT O(") CHARACTER
    CS_ECCCODE NEXT * WHT O(") CHARACTER
    CS_MFRCODE NEXT * WHT O(") CHARACTER
    CS_QTY_BUG NEXT * WHT O(") CHARACTER
    CS_VAL_BUG NEXT * WHT O(") CHARACTER
    Record 1: Rejected - Error on table CUSTOMER_BACKUP, column CS_YOB_BAL.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 2: Rejected - Error on table CUSTOMER_BACKUP, column CS_CURR.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 3: Rejected - Error on table CUSTOMER_BACKUP, column CS_CURR.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 50: Rejected - Error on table CUSTOMER_BACKUP, column CS_MOB_BAL.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 51: Rejected - Error on table CUSTOMER_BACKUP, column CS_MOB_BAL.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    MAXIMUM ERROR COUNT EXCEEDED - Above statistics reflect partial run.
    Table CUSTOMER_BACKUP:
    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: 254904 bytes(26 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 Wed Aug 28 13:30:29 2002
    Run ended on Wed Aug 28 13:30:29 2002
    Elapsed time was: 00:00:00.18
    CPU time was: 00:00:00.08
    =================================================================
    Regards,
    Bimal

    Hi,
    I am bit late ,I cannot say bit, If we use TRAILING NULL COLS in the control file your problem should be fixed.
    TRAILING NULLCOLS tells SQL*Loader to treat any relatively positioned columns that are not present in the record as null columns.
    For example, if the following data
    10 Accounting
    is read with the following control file
    INTO TABLE dept
    TRAILING NULLCOLS
    ( deptno CHAR TERMINATED BY " ",
    dname CHAR TERMINATED BY WHITESPACE,
    loc CHAR TERMINATED BY WHITESPACE
    and the record ends after DNAME. The remaining LOC field is set to null. Without the TRAILING NULLCOLS clause, an error would be generated due to missing data.

  • Re: Sql*loader 11g - Error ORA-12899

    My Bad file has first 2 records like this:
    MEMB_NUMBER,ID_NUMBER,ASSIGNED_MEMB_NUMBER,ASSOC_AMT,ASSOC_TYPE,DATE_ADDED,DATE_MODIFIED,OPERATOR_NAME,USER_GROUP,LOCATION_ID,
    0000000107,0000828633, ,1.5,J,22-FEB-02,12-JUN-02,MSUM080_MEMB_CONV,00,,
    0000002301,0000800007, ,297.5,J,03-AUG-00,12-JUN-02,MSUM080_MEMB_CONV,00,,
    My Log file says:
    Record 1: Rejected - Error on table OWBREP.MEMB_ENTITY, column ID_NUMBER.
    ORA-12899: value too large for column "OWBREP"."MEMB_ENTITY"."ID_NUMBER" (actual: 20, maximum: 10)
    Record 2: Rejected - Error on table OWBREP.MEMB_ENTITY, column ASSOC_AMT.
    ORA-01722: invalid number
    Decription of target table:
    memb_number
    varchar2(10 byte)
    y
    id_number
    varchar2(10 byte)
    y
    assigned_memb_number
    varchar2(15 byte)
    y
    assoc_amt
    number(14,2)
    y
    assoc_type
    char(1 byte)
    y
    date_added
    date
    y
    date_modified
    date
    y
    operator_name
    varchar2(32 byte)
    y
    user_group
    varchar2(2 byte)
    y
    location_id
    number
    y
    Can you please tell me why the sqlldr is throwing error?The data seems correct to me.

    Hi,
    Now again I am facing problem..
    I mean my log file throws error
    "Record 2: Rejected - Error on table OWBREP.ADDRESS, column USER_GROUP.
    ORA-12899: value too large for column "OWBREP"."ADDRESS"."USER_GROUP" (actual: 27, maximum: 2)"
    and my record when I see in bad file is:
    "0000810722,3,00000000,00000000,H,A,Y, , , , , ,1777 Hull Road, , , ,Mason,MI,48854,   ,            , , ,12-MAR-02,N,0,,, ,00000000,0,FAC, , ,N,N, ,1777 Hull Road,Mason, MI 48854, , , , , , , ,12-MAR-02,10-FEB-05,FIX075_ADDR_VERSION_UPGRADE,00,,"
    I have checked my control file and the table structure .They are same.
    The problem is that I have an address field before this user_group column which has value like "Mason,MI,48854" .So sql loader is reading these as separate columns because of comma.That is why the order is getting messed up and I am getting this error.Can you suggest what should I do resolve this kind of error?

  • SQL*LOADER ERROR WHILE LOADING ARABIAN DATA INTO UNICODE DATABSE

    Hi,
    I was trying to load arabic data using sql*loader and the datafile is in .CSV format.But i am facing a error Value to large for a column while loading and some data are not loaded due to this error.My target database character set is..
    Characterset : AL32UTF8
    National Character set: AL16UTF16
    DB version:-10g release 2
    OS:-Cent OS 5.0/redhat linux 5.0
    I have specified the characterset AR8MSWIN1256/AR8ISO8859P6/AL32UTF8/UTF8 separately in the sql*loader control file,but getting the same error for all the cases.
    I have also created the table with CHAR semantics and have specified the "LENGTH SEMANTICS CHAR" in the sql*loader control file but again same error is coming.
    I have also changed the NLS_LANG setting.
    I am getting stunned that the data that i am goin to load using sql*loader, it is resided in the same database itself.But when i am generating a csv for those datas and trying to load using sql*loader to the same database and same table structure,i am getting this error value too large for a column.
    whats the probs basically???? whether the datafile is problemetic as i am generating the csv programmetically or is there any problem in my approach of loading unicode data.
    Please help...

    Here's what we know from what you've posted:
    1. You may be running on an unsupported operating system ... likely not the issue but who knows.
    2. You are using some patch level of 10gR2 of the Oracle database but we don't know which one.
    3. You've had some kind of error but we have no idea which error or the error message displayed with it.
    4. You are loading data into a table but we do not have any DDL so we do not know the data types.
    Perhaps you could provide a bit more information.
    Perhaps a lot more. <g>

  • Using SQL Loader in more than one table

    Hi all,
    I have a new question for those who have used SQL Loader. I
    have never used it and I just know that I need a control file to
    tell SQL Loader what is my flat file layout and what table the
    information goes to. My problem is: my flat file has information
    that goes to two tables in my schema. Those files are very big
    (aprox 280Mb) and I would like to read them just once. Can I do
    this with SQL Loader?
    Other question, is that the fastest way to import data from
    flat files becouse I am using PERL and it takes aprox. 9 hours
    to import 10 of those files. I could use UTL_FILE to read it but
    I heard that SQL Loader was better.
    Thanks for your cooperation
    (Robocop)
    Marcelo Lopes
    Rio de Janeiro - Brazil

    SQL*Loader is the fastest way to load, particularly in direct parallel mode, and can certainly load to multiple tables.
    >
    My advice would be to have a look at the examples given in the Oracle Utilities guide, there is one for loading to multiple
    tables, which I have pasted below.
    >
    -- Loads EMP records from first 23 characters
    -- Creates and loads PROJ records for each PROJNO listed
    -- for each employee
    LOAD DATA
    INFILE &#8217;ulcase5.dat&#8217;
    BADFILE &#8217;ulcase5.bad&#8217;
    DISCARDFILE &#8217;ulcase5.dsc&#8217;
    REPLACE
    INTO TABLE emp
    (empno POSITION(1:4) INTEGER EXTERNAL,
    ename POSITION(6:15) CHAR,
    deptno POSITION(17:18) CHAR,
    mgr POSITION(20:23) INTEGER EXTERNAL)
    INTO TABLE proj
    -- PROJ has two columns, both not null: EMPNO and PROJNO
    WHEN projno != &#8217; &#8217;
    (empno POSITION(1:4) INTEGER EXTERNAL,
    projno POSITION(25:27) INTEGER EXTERNAL) -- 1st proj
    INTO TABLE proj
    WHEN projno != &#8217; &#8217;
    (empno POSITION(1:4) INTEGER EXTERNAL,
    projno POSITION(29:31 INTEGER EXTERNAL) -- 2nd proj
    INTO TABLE proj
    WHEN projno != &#8217; &#8217;
    (empno POSITION(1:4) INTEGER EXTERNAL,
    projno POSITION(33:35) INTEGER EXTERNAL) -- 3rd proj
    see the documentation for a complete explanation of the configuration.
    Thanks, I will read it.

  • Oracle RAC and sql loader

    hi all,
    We have Oracle 10g RAC on IBM AIX
    Today i will be uploading data in a table through sql loader.
    I want that at the time of insertion only data which i am inserting goes into the table,As i am using sequence on particular column A.
    Problem is If i shutdown database then i will not to able to insert data and if i doesnt shutdown db value for that column A is generated automatically when application works.
    i have recommanded that we should stop connectivity of application with database then i will perform insertion but some people are saying no.Find other method
    What steps should i do?

    Ok i thing my question was not clear
    I have table XYZ
    A B C
    1 2 3
    4 4 5
    if application is connected to database value to Coulmn is incremented
    A B C
    1 2 3
    4 4 5
    5 6 7
    i have to insert into table XYZ using sql loader giving sequence (4,1) on column A.
    But if it is connected to application it will give me error of PK.
    as Value 5 is already inserted by application so how can i stop this.
    so that i can have the max value of coulmn and start sequence
    Hope this time make u clear.
    sorry for bad english

  • SQL*Loader

    I am in the process of learning Oracle, i need some help in using Sql*loader.
    My datafile contains the following data with ~ as the delimiter,
    00300~9099~98~DDAS~TEMP
    I need to load the first 3 columns (00300~9099~98) from the datafile
    to a single coulmn in the table, basically i need to concat the 3 column values from the datafile and load it to the column of the
    table, how do i do it?
    Please help me.
    null

    I would suggest doing the concatenation in something like access or excel so that datafile is already in the required format.

  • Using SQL Loader to insert data based on conditionally statements

    I would like to use sql loader to insert records from a single text file into an Oracle database table. Sounds easy but the problem is that I need to check the existence of data in another table (Table A) before data can be loaded into Table B.
    Table A has two columns: dept_no (primary key value) and dept_name (char)
    Table B has five columns: emp_no (primary key value), dept_no (foreign key value to Table A), employee (char), job_title (char) and salary (number)
    Text File looks like this:
    Finance Jones President 10000
    HR Smith Admin 2000
    HelpDesk Jenkins Technician 3000
    Problem:
    1. I need sql loader to insert records into Table B by first checking if the first field in the file is in Table A.
    2. If value exists get it's dept_no value.
    3. If value doesn't exist discard record ( I might want to have sql loader insert a new record for this into Table A)
    4. Using value from #2, insert the value in Table B for dept_no column.
    5. Also assign a sequence value for the emp_no value in Table B.
    Any guidance is greatly appreciated.
    Thanks,

    Hello,
    I am not sure this is possible with SQL loader. I would rather use an external table based on your file.
    Then, I would use SQL to load your data into your table, based on your conditions.
    Your request is not very complicated, writing the SQL to do that will be really more simple than trying to do it with SQL loader.
    Hope it will help.
    Regards,
    Sylvie

Maybe you are looking for