Help on SQL Loader Sequence

Hi all,
I am kind of wondering whether we can give same sequence number to the whole data file.
Explanation:
I need to load a data file into the table, i know how to use the sequence in Sql loader control file. But the problem is i need the same sequence number for every record that is inserted into the table from the Datafile,
Say the datafile has 500 record
and i need all the 500 records to have the same sequence number.
when i load another datafile i need to have a different sequence number for all the records that are inserted into the table.
Thanks in advance.
Edited by: 943254 on Mar 11, 2013 11:08 AM

Then you will have to look for a solution elsewhere - either the file will need to come preseeded with the value, or you will need to perform post-processing on the loaded data to add the constant value, or something else.
HTH
Srini

Similar Messages

  • Can u give an detail examples or help on SQL- loader

    Can u give an detail examples or help on SQL- loader
    I need full details on this how to run and what are the pre requirements for this and what
    Can u give an example with unix+sql loader

    The Oracle Utilities manual has a chapter on SQL*Loader Case Studies
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch10.htm#1656
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • SQL*LOADER에서 SEQUENCE 함수와 DECODE 함수 사용하는 방법

    제품 : ORACLE SERVER
    작성날짜 : 2003-08-22
    SQL*LOADER에서 SEQUENCE 함수와 DECODE 함수 사용하는 방법
    ========================================================
    PURPOSE
    Unique한 DATA을 load하고자 할때 쓰이는 SEQUENCE () 함수와 DECODE 함수의
    사용에 대해 알아보고자 한다.
    Explanation
    table의 data에 unique한 값을 넣기 위해 sequence을 만들어 사용한다. 이것은
    블루틴 #10863 을 참고하면 알수 있다. 이때 loader에서 database의 sequence기능이
    아닌 sequence() 함수를 사용하는 것을 테스트해 보고자 한다.
    또한 decode 함수를 사용하는 내용을 여기서 다루고자 한다.
    함수를 사용하는 경우는 conventional path load인 경우에만 가능하며 direct path load
    인 경우는 적용되지 않음을 주의하자.
    함수를 사용할때 참조하고자 하는 컬럼앞에 콜론(:)을 붙이면 된다.
    SEQUENCE 를 사용하면 각각의 레코드를 로드할때 특정 컬럼을 증가할수 있다.
    단 무시되거나 잘못되어 들어가지 않은 레코드에 대해서는 증가을 하지 않기
    때문에 주의하여야 한다.
    SEQUENCE 함수의 옵션에 대해 알아보자.
    SEQUENCE(n,increment) - 지정한 n 값부터 시작하여 increment 값만큼 증가한다.
    SEQUENCE(COUNT,increment) - table에 이미 존재하는 로우들을 count한 수에서
    시작하여 increment 값만큼 증가한다.
    SEQUENCE(MAX, increment - 해당 컬럼의 maximum 값에서 시작하여 increment
    값만큼 증가한다.
    Examples
    < Sequence 함수 사용 예 >
    1. sample table 생성
    create table t1
    (field1 number, field2 number, field3 varchar2(10));
    2. controlfile생성
    <sequence1.ctl>
    load data
    infile 'data1.dat'
    into table t1
    fields terminated by "," optionally enclosed by '"'
    (field1 SEQUENCE(MAX,1),
    field2,
    field3 )
    3. load할 datafile생성
    <data1.dat>
    1234, "ABC"
    3456, "CDF"
    4. 실행해 본다.
    $ sqlldr scott/tiger sequence1.ctl
    SQL> select * from t1;
    FIELD1 FIELD2 FIELD3
    1 1234 ABC
    2 3456 CDF
    < Decode 함수 사용 예 >
    test1 column이 'hello'이면 'goodbye'을 아니면 test1 column값을 로드하고자 한다.
    1. sample table 생성
    create table testldr
    (test1 varchar2(10), test2 varchar2(10));
    2. controlfile생성
    <decode1.ctl >
    Load data
    infile 'data2.dat'
    into table testldr
    fields terminated by ',' optionally enclosed by '"'
    (test1,
    test2 "decode(:test1, 'hello', 'goodbye', :test1)")
    3. load할 datafile생성
    <data2.dat>
    hello,""
    goodbye,""
    hey,""
    hello,""
    4. 실행해 본다.
    $ sqlldr scott/tiger decode1.ctl
    SQL> select * from testldr;
    SQL> select * from testldr;
    TEST1 TEST2
    hello goodbye
    goodbye goodbye
    hey hey
    hello goodbye
    Reference Ducument
    <Note 175126.1>
    <Note:1058895.6>
    <Note:1083518.6>

  • Help in sql loader loading a large datafile.

    Hi All
    Could some one help me in loading the xls file which is about 250MB AND got about 2981807 rows into a database table
    i try to open the XLS file it just opened with 65000 records only but i have lot more records in it.
    thanks in advance

    hi i user the sql loader but the file is too big to handel like the file is not opened in notepad or xls sheet...
    is there any other way to split the large file

  • Help with SQL LOADER

    I have a data file that looks like:
    REC001;TO_NAME;TO_ADDR;TO_PHONE
    REC002;ITEM_ID1;DATE_DELIVERED1
    REC002;ITEM_ID2;DATE_DELIVERED2
    REC002;ITEM_ID3;DATE_DELIVERED3
    REC002;ITEM_ID4;DATE_DELIVERED4
    i want to load this in the Database using SQL LOADER in this format:
    NAME | ADDR | PHONE | ITEM | DATE DELIVERED
    TO_NAME TO_ADDR TO_PHONE ITEM_ID1 DATE_DELIVERED1
    TO_NAME TO_ADDR TO_PHONE ITEM_ID2 DATE_DELIVERED2
    TO_NAME TO_ADDR TO_PHONE ITEM_ID3 DATE_DELIVERED3
    TO_NAME TO_ADDR TO_PHONE ITEM_ID4 DATE_DELIVERED4
    Basically i want the name, addr, phone from REC001 to be repeated every time i load REC002.
    Any help on how to do this.

    The subject of this forum is AQ.
    AQ <> SQL*Loader
    Please delete this post and post in Database - General
    When you do include full version information and format your post using PRE tags (explained in the FAQ).

  • Help with sql loader charsets

    I was wondering if anyone could assist me with a sql loader question. I am trying to use it to load some hungarian data. It always turns the Ő character into an upside down question mark. I understand that it is because the database doesn't understand what that character is. Can someone help me find out how to resolve that? The database is UTF-8. If I paste the character in to the application, it takes it. I have tried all kinds of values for the CHARSET parameter in the .ctl file, but nothing seems to work....

    I believe we are using iso 8859-1.
    I am having a difficult time thinking that it could be we don't have the appropriate installations - because if we paste it in via the oracle application we can see it in a form. If we sql load that same character and look at it in an oracle form, we see the question marks.
    i've looked at many of the documents on tahiti already, and found some helpful stuff, but no explanation for the problem i am having so far :)

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

  • SQL loader sequence

    I am using SQL LOader and has used SEQUENCE Function to a column of the table in the control file
    That will create a new sequence number for each record.What I need is just one sequence number for each file. say 200 records. Records of particular file need to have same sequence number
    The next file will have another number...so on and so forth.
    Pls suggest if you have any idea on the same
    Thanks

    You've posted enough to know you need to provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    >
    I am using SQL LOader and has used SEQUENCE Function to a column of the table in the control file
    That will create a new sequence number for each record.What I need is just one sequence number for each file. say 200 records. Records of particular file need to have same sequence number
    The next file will have another number...so on and so forth.
    Pls suggest if you have any idea on the same
    >
    In 11g you could add a compound trigger on the table. Get the sequence value in the BEFORE statement section of the trigger and then use that value in the BEFORE ROW section of the trigger.

  • Need help on sql loader error

    A similar issue is posted on http://www.dbforums.com/database-concepts-design/927987-using-sql-loader-load-data-multiple-files.html, but not a solution yet there, any help on this issue is highly appreciated.
    an alternative solution is also appreciated?
    Thanks!
    Hi All,
    I have a peculiar error while I try to load 2 tables(table name: enroll_emp_back & enroll_dep_back) using SQLLDR, the source file is a .csv file.
    CTL FILE CONTENT:
    LOAD DATA
    TRUNCATE
    INTO TABLE enroll_emp_back
    WHEN (1:8) = 'EMPLOYEE'
    FIELDS TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (type NULLIF type= BLANKS,
    enrollstmt_ctl_cust_seqnum NULLIF enrollstmt_ctl_cust_seqnum= BLANKS,
    pctl_employee_seqnum NULLIF pctl_employee_seqnum= BLANKS,
    pctl_lot NULLIF pctl_lot= BLANKS,
    pctl_counter NULLIF pctl_counter= BLANKS,
    first_name NULLIF first_name= BLANKS,
    last_name NULLIF last_name= BLANKS,
    mi NULLIF mi= BLANKS,
    ssn NULLIF ssn= BLANKS,
    cssn NULLIF cssn= BLANKS,
    emp_id NULLIF emp_id= BLANKS,
    pin NULLIF pin= BLANKS,
    addr1 NULLIF addr1= BLANKS,
    addr2 NULLIF addr2= BLANKS,
    addr3 NULLIF addr3= BLANKS,
    city NULLIF city= BLANKS,
    state_cd NULLIF state_cd= BLANKS,
    zip NULLIF zip= BLANKS,
    country NULLIF country= BLANKS,
    birth_date NULLIF birth_date= BLANKS,
    hire_date NULLIF hire_date= BLANKS,
    adj_service_date NULLIF adj_service_date= BLANKS,
    elig_date NULLIF elig_date= BLANKS,
    smoker_ind NULLIF smoker_ind= BLANKS,
    spouse_smoker_ind NULLIF spouse_smoker_ind= BLANKS,
    partic_grp_id NULLIF partic_grp_id= BLANKS,
    enroll_window_start NULLIF enroll_window_start= BLANKS,
    enroll_window_end NULLIF enroll_window_end= BLANKS,
    total_ee_cost NULLIF total_ee_cost= BLANKS,
    total_er_cost NULLIF total_er_cost= BLANKS,
    emp_custom1 NULLIF emp_custom1= BLANKS,
    emp_custom2 NULLIF emp_custom2= BLANKS,
    emp_custom3 NULLIF emp_custom3= BLANKS,
    emp_custom4 NULLIF emp_custom4= BLANKS,
    emp_custom5 NULLIF emp_custom5= BLANKS,
    custom1 NULLIF custom1= BLANKS,
    ctl_ins_dttm NULLIF ctl_ins_dttm= BLANKS,
    ctl_upd_dttm NULLIF ctl_upd_dttm= BLANKS,
    ctl_trans_seqnum NULLIF ctl_trans_seqnum= BLANKS,
    ctl_upd_seq NULLIF ctl_upd_seq= BLANKS,
    ctl_deleted_ind NULLIF ctl_deleted_ind= BLANKS,
    ben_year NULLIF ben_year = BLANKS,
    activity_id NULLIF activity_id= BLANKS,
    client_name NULLIF client_name= BLANKS,
    doc_type NULLIF doc_type= BLANKS,
    environment_type NULLIF environment_type= BLANKS
    INTO TABLE enroll_dep_back
    WHEN (1:9) = 'DEPENDENT'
    FIELDS TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (type NULLIF type= BLANKS,
    enrollstmt_ctl_cust_seqnum NULLIF enrollstmt_ctl_cust_seqnum= BLANKS,
    pctl_employee_seqnum NULLIF pctl_employee_seqnum= BLANKS,
    pctl_enroll_dep_num NULLIF pctl_enroll_dep_num= BLANKS,
    pctl_dep_num NULLIF pctl_dep_num= BLANKS,
    first_name NULLIF first_name= BLANKS,
    last_name NULLIF last_name= BLANKS,
    ssn NULLIF ssn= BLANKS,
    birth_date NULLIF birth_date= BLANKS,
    relation NULLIF relation= BLANKS,
    sex NULLIF sex= BLANKS,
    student_ind NULLIF student_ind= BLANKS,
    disabled_ind NULLIF disabled_ind= BLANKS,
    ctl_ins_dttm NULLIF ctl_ins_dttm= BLANKS,
    ctl_upd_dttm NULLIF ctl_upd_dttm= BLANKS,
    ctl_trans_seqnum NULLIF ctl_trans_seqnum= BLANKS,
    ctl_upd_seq NULLIF ctl_upd_seq= BLANKS,
    ctl_deleted_ind NULLIF ctl_deleted_ind= BLANKS,
    den_covered NULLIF den_covered= BLANKS,
    deplife_covered NULLIF deplife_covered= BLANKS,
    empadd_covered NULLIF empadd_covered= BLANKS,
    med_covered NULLIF med_covered= BLANKS,
    supadd_covered NULLIF supadd_covered= BLANKS,
    suplife_covered NULLIF suplife_covered= BLANKS,
    vis_covered NULLIF vis_covered= BLANKS
    Error I get:
    Table ENROLL_DEP_BACK:
    0 Rows successfully loaded.
    0 Rows not loaded due to data errors.
    1 Row not loaded because all WHEN clauses were failed.
    1 Row not loaded because all fields were null.
    I dont know why the 'ENROLL_DEP_BACK' table is not getting loaded. If i change the above ctl file in such a way that it first loads ENROLL_DEP_BACK table, then the 'enroll_emp_back' table is not getting loaded.
    Please help me on this?
    Source File:
    EMPLOYEE,2322,181340,1,1,Gervaise,Babic,,704345064,704-34-5064,10223914,12345,123 Felton Street,Building 1,Suite 1,Marlborough,WI,53121,USA,11-May-60,9-Mar-09,7-Jan-04,1-Jan-07,N,N,FTNES,15-Apr-09,22-Apr-09,$0.00 ,$96.78 ,9-Apr-09,,,,,,15-Apr-09,15-Apr-09,1103597,4,N,2009,OE,NESTLE,ENROLL,D
    DEPENDENT,2322,181340,1,1,Antony,Broking,765304168,4/26/1962,SP,M,N,N,15-Apr-09,15-Apr-09,1103597,1,N,N,N,N,N,,,N
    SQL command used: SQLLDR wedb/wedbo@nestle_10_sd1 CONTROL=AENUSA2.ctl data=ENROLL.csv LOG=AENUSA.log DIRECT=y
    Thank You
    Edited by: HarinathArasu on Oct 7, 2009 6:26 AM
    Edited by: HarinathArasu on Oct 7, 2009 7:17 AM
    Edited by: HarinathArasu on Oct 7, 2009 8:24 AM
    Edited by: HarinathArasu on Oct 7, 2009 8:24 AM

    When this error occurs it usually means there's some underlying schema changes taking place when you're trying to add a new article
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Seeking help on SQL loader

    I am trying to load the flat-file to the oracle database by using SQL LOADER utility but i am getting the error.
    i am putting the .ctl file and the error message along with.
    kindly help me at earliest as I am stuck with that.
    Thank you.
    ------------ctl file----------------------
    LOAD DATA
    INFILE *
    INTO TABLE dept
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (deptno, dname, loc)
    BEGINDATA
    12,RESEARCH,"SARATOGA"
    10,"ACCOUNTING",CLEVELAND
    11,"ART",SALEM
    13,FINANCE,"BOSTON"
    21,"SALES",PHILA.
    22,"SALES",ROCHESTER
    42,"INT'L","SAN FRAN"
    ----------------error message--------------
    SQL*Loader: Release 8.1.6.0.0 - Production on Thu Feb 8 15:40:48 2001
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Control File: dept.ctl
    Data File: dept.ctl
    Bad File: dept.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 65536 bytes
    Continuation: none specified
    Path used: Conventional
    Table DEPT, loaded from every logical record.
    Insert option in effect for this table: INSERT
    Column Name Position Len Term Encl Datatype
    DEPTNO FIRST * , O(") CHARACTER
    DNAME NEXT * , O(") CHARACTER
    LOC NEXT * , O(") CHARACTER
    SQL*Loader-601: For INSERT option, table must be empty. Error on table DEPT
    null

    Try using following script : -
    LOAD DATA
    INFILE *
    APPEND
    INTO TABLE dept
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (deptno, dname, loc)
    BEGINDATA
    12,RESEARCH,"SARATOGA"
    10,"ACCOUNTING",CLEVELAND
    11,"ART",SALEM
    13,FINANCE,"BOSTON"
    21,"SALES",PHILA.
    22,"SALES",ROCHESTER
    42,"INT'L","SAN FRAN"
    null

  • Hi i need a help on sql loader

    Hi all
    How can i check weather the SQL Loader is installed in my system or not .
    Thanks and regards
    goutham

    Hi
    it is located in D:\oracle\product\10.2.0\client_1\BIN. how should i acees this with command prompt .
    i am totaly new to it and need to know it if any document is avialable on sql loader can any body pls send it me r say me where can i found it on net
    thanks in advance
    goutham

  • Help on SQL Loader When Clause

    I have 2 Oracle tables of exact same structure.
    ENO NUMBER
    PARENT NUMBER
    CHILD NUMBER
    ENAME VARCHAR2 (50 Byte)
    ADDRESS VARCHAR2 (50 Byte)
    CITY VARCHAR2 (50 Byte)
    SRCFILENAME VARCHAR2 (50 Byte)
    SDATE VARCHAR2 (400 Byte)
    Current_Load VARCHAR2 (1 Byte)
    Have a data file and a loader control file which loads data in these 2 tables.
    I need to do a conditional load using a when clause.
    Condition : when PARENT=CHILD, load in table 2 else load in table 1
    My control file looks like this .
    LOAD DATA
    INFILE 'TEST_20120815.txt'
    APPEND INTO TABLE test1
    fields terminated by "|"
    trailing nullcols
    eno,
    parent,
    child,
    ename,
    address,
    city ,
    sdate "to_date(:sdate,'DD/MM/YYYY')",
    SrcFileName,
    col7 filler,
    "Current_Load" constant 'Y'
    INTO TABLE test2 when (parent=child)
    fields terminated by "|"
    trailing nullcols
    eno position(1),
    parent,
    child,
    ename,
    address,
    city ,
    sdate "to_date(:sdate,'DD/MM/YYYY')",
    SrcFileName,
    col7 filler,
    "Current_Load" constant 'Y'
    ) But this doesn't work. It works fine if I give direct value like PARENT='P'.
    Any idea as how to compare the 2 fields while doing conditional load?

    You cannot compare 2 fields with the WHEN clause in an SQL*Loader control file.
    only literal values as defined by the syntax:
    http://docs.oracle.com/cd/B19306_01/server.102/b14215/ldr_control_file.htm#i1005657
    As already suggested, you would be better to load your data using an external table where you can apply any conditions you want during your SQL query that is fetching the data.

  • Help on SQL  Loader

    What is sql loader ?
    please explain through example or post the link.
    Thanks in advance
    Pankaj

    HI,
    SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle database.
    This link
    http://www.oracle.com/technology/products/database/utilities/htdocs/sql_loader_overview.html
    thanks

  • 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

  • Pls Help for Sql Loader utility

    Dear friends,
    I want to execute Sql Loader utility by procedure.
    Can anyone give me any idea about it.
    Thanks in adavance.

    Why?
    Why build a kludgy and unscalable application?
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • Question regarding the If-then-else function

    Hi folks , I have been constantly putting threads on this subject for the past day,  hope it doesn't annoy any one here. My scenario is really simple, and i am  almost close to the solution, but there is just 1 thing missing and i know that is a very

  • Copy Standard SAP Print Program

    Dear everyone,   Do anyone can give some guide on coping the standard SAP print program - RVADDN01. Regards, Kit

  • Multiple Queue problem

    Hi, I had created 3 Queue between two database. Source : Oracle 8.1.7 and Target is 9.2 All the three queues are independent except for the dblink btw source and target. While testing the fail over,we are bouncing the database at the target side and

  • Weblogic server not properly started in myeclipse

    Click to email this message Feb 7, 2009 6:05:06 PM EST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 1.5.0_11-b03 from Sun Microsystems Inc.> <Feb 7, 2009 6:05:08 PM EST> <Info> <Configuration

  • Full text search in CMSK 9.0.3  WebStarterApp

    I deployed WebStarterApp on CMSDK 9.0.3 and I cannot perform full text search on the CMSDK document. Is there anybody who encounters the same problem ? Thanks