SQL*Loader defaultif?

hi,
can any one give me example of SQL*Loader and how we should use default if clause?
i am studying the following document but i cant seem to find one example
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_modes.htm#i1008335
plz assist,
regards
nic

http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm#sthref1146
Regards
Etbin

Similar Messages

  • SQL Loader- Default value is not inserted in table by direct method

    Hi All,
    I am trying to load data from a file to a table by SQL Loader. There is a particular date column which I am not loading from the File but have used a Default constraint to put SYSDATE in it. When I am using direct method load then it is not inserting nothin in this column but in conventional method it is inserting SYSDATE. But I want to do the load by direct method. Can anybody provide me a solution as how to load default value in direct method?
    Thanks & regards.
    Sudipta

    For this special case, you can specify:
    column_name SYSDATE
    in your SQL*Loader control file.

  • SQL Loader, CLOB, delimited fields

    Hello.
    I have to load using SQL Loader data from csv file into table, which one field is CLOB type.
    Here is how ctl file initially looked like:
    UNRECOVERABLE
    LOAD DATA
    INFILE '.\csv_files\TSH_DGRA.csv'
    BADFILE '.\bad_files\TSH_DGRA.bad'
    DISCARDFILE '.\dsc_files\TSH_DGRA.dsc'
    APPEND
    INTO TABLE TSH_DGRA
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    ID_OBJ_TSHD,
    PR_ZOOM_TSHD,
    PR_GRID_TSHD,
    PR_ELMGR_TSHD CHAR(4000) OPTIONALLY ENCLOSED BY '<clob>' AND '</clob>',
    PR_ALRMGR_TSHD CHAR(4000) OPTIONALLY ENCLOSED BY '<clob>' AND '</clob>'
    Problems are fields PR_ELMGR_TSHD and PR_ALRMGR_TSHD (CLOBs in table TSH_DGRA). Until data which should be loaded into CLOB fields are under 4000 characters long, it works fine, but what should I do if I want to load data which are longer than 4000 characters?
    If found on Link:[http://download.oracle.com/docs/cd/B14117_01/server.101/b10825/ldr_loading.htm#i1006803] which one sentence said that:
    "SQL*Loader defaults to 255 bytes when moving CLOB data, but a value of up to 2 gigabytes can be specified. For a delimited field, if a length is specified, that length is used as a maximum. If no maximum is specified, it defaults to 255 bytes. For a CHAR field that is delimited and is also greater than 255 bytes, you must specify a maximum length. See CHAR for more information about the CHAR datatype."
    So, my question is, how to specify "up to 2gb" as text said? I can not use CHAR datatype because it is limited to 4000 characters. And I have to load about 60000 characters. I also can not use technique where all data for every CLOB field are in separate files.

    Just specify the maximum expected size:
    PR_ELMGR_TSHD CHAR(100000) OPTIONALLY ENCLOSED BY '<clob>' AND '</clob>',
    PR_ALRMGR_TSHD CHAR(1000000) OPTIONALLY ENCLOSED BY '<clob>' AND '</clob>'
    The CHAR(1000000) will allow SQLLDR to handle up to 1000000 bytes of input text.

  • How to load a default value in to a column when using sql loader

    Im trying to load from a flat file using sql loader.
    for 1 column i need to update using a default value
    how to go about this?

    Hi!
    try this code --
    LOAD DATA
       INFILE 'sample.dat'
       REPLACE
       INTO TABLE emp
       empno   POSITION(01:04) INTEGER EXTERNAL NULLIF empno=BLANKS,
       ename   POSITION(06:15)  CHAR,
       job         POSITION(17:25)  CHAR,
       mgr       POSITION(27:30)  INTEGER EXTERNAL NULLIF mgr=BLANKS,
       sal        POSITION(32:39)  DECIMAL EXTERNAL NULLIF sal=BLANKS,
       comm   POSITION(41:48)  DECIMAL EXTERNAL DEFAULTIF comm = 100,
       deptno  POSITION(50:51)  INTEGER EXTERNAL NULLIF deptno=BLANKS,
       hiredate POSITION(52:62) CONSTANT SYSDATE
      )-hope this will solve ur purpose.
    Regards.
    Satyaki De.

  • SQL Loader, nested tables and default values

    Is there a way to specify a default value for a nested table entry when SQL*Loader encounters a 'null' value?
    I want to avoid this:
    Record 5: Rejected - Error on table LEVEL_DESC, column LEVELS.
    NULL nested table element is not allowed

    Use the NULLIF parameter in your control file for the nested table objects.
    e.g
    LOAD DATA
    INFILE 'level_data.dat'
    INTO TABLE LEVEL
    (LEVEL_ID POSITION (01:05) CHAR
    LEVEL_NAME POSITION (07:20)
    LEVEL_DESC COLUMN OBJECT
    (LEVELS POSITION (22:25) CHAR NULLIF LEVEL_DESC.LEVELS=BLNAKS,
    ... ))

  • How to set default directory for SQL LOADER

    hi all,
    i wanted to know how can we setup a default directory for SQL LOADER if at all we can. i connot place my control and data files in local system and use them at command prompt. rather i wanted to know if we can set default directory that the loader can use. this requirement is basically to enable all the clients to upload the data placed on the server and use the loader utility.
    thanks in advance,
    Basavraj

    Ella,
    You don't say which version of SQL Developer you are using via Citrix, but just setting the SQLDEVELOPER_USER_DIR hasn't worked for a long time (see Re: SQLDEVELOPER_USER_DIR does not function anymore). Also, since version 1.5, the default for the user directory (now set via ide.user.dir as shown below) is under the user profile area (relative to %APPDATA%), which you should be able to write to, even on Citrix.
    Assuming that neither of those help, you will need to get whoever installed SQL Developer on the Citrix C: drive to modify the sqldeveloper.conf to have a line like, where the path exists for everyone who will be using the shared SQL Developer (assumes everyone has a H: drive):
    AddVMOption -Dide.user.dir=H:\sqldeveloperAn alternative (depending on how you start SQL Developer via Citrix), is to create your own shortcut to start SQL Developer with something like:
    sqldeveloper -J-Dide.user.dir="%SQLDEVELOPER_USER_DIR%"theFurryOne

  • Defaulting org id value into a table through SQL Loader program

    Hi ,
    We have a requirement that we need to load some data from flat file to a table.we are using sql loader to do that. so far no problem but now the requirement is that we need to populate the org id from which we are running the program.
    I tried fnd_profile.value('ORG_ID') and it is populating site level org id.
    Coudl any one please help me how to default org id or request id into a table through sql loader program.
    Thanks,
    Y

    user12001627 wrote:
    Hi Srini,
    Thanks for looking into this!!
    We are on EBS 11.5.10 and OS is solaris.
    I tried fnd_profile,fnd_global but no luck.
    Here is the control file which we are using to load data.
    load data
    infile *
    replace into table XXXX_YYYY_STAG
    trailing nullcols
    (line POSITION(1:2000)
    I would like to populate org id when I load the data from file.unfortunately there is no identifier in the file that says for which org id the data is in the file.Only the way to identify the file org is based on file name
    Where do you want to populate the ORG_ID ? There is no column for it in your stage table above
    Is there way we can pass through concurrent program parameters?
    Thanks
    YHTH
    Srini

  • Defaulting values SQL Loader

    Hi All ,
      I have a use case in sql loader where in i have two columns A and B in a Table.
       My Use case for control file is to get B from csv ( which is a mandatory column)  . A is optional in CSV . if A is populated take that value for A . If not default if from B.
      Thing i have tried is :
    B                        ,    
    A  EXPRESSION : "NVL( :A, :B) " ,
    This is failing saying that
    Invalid bind variable A in SQL string for column A.
    Any ideas ? I know we could define a function. . But any better way to do with control files itself ?
    Thanks,
    Bibin

    Remove the word EXPRESSION.
    SCOTT@orcl12c> host type test.csv
    bval1,aval1,
    bval2,,
    SCOTT@orcl12c> host type test.ctl
    load data
    infile test.csv
    into table a_table
    fields terminated by ','
    trailing nullcols
    (b,
    a "nvl (:a, :b)")
    SCOTT@orcl12c> create table a_table
      2    (b  varchar2(5),
      3     a  varchar2(5))
      4  /
    Table created.
    SCOTT@orcl12c> host sqlldr scott/tiger control=test.ctl log=test.log
    SQL*Loader: Release 12.1.0.1.0 - Production on Fri Nov 15 13:46:40 2013
    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
    Path used:      Conventional
    Commit point reached - logical record count 2
    Table A_TABLE:
      2 Rows successfully loaded.
    Check the log file:
      test.log
    for more information about the load.
    SCOTT@orcl12c> select * from a_table
      2  /
    B     A
    bval1 aval1
    bval2 bval2
    2 rows selected.

  • Comparison of Data Loading techniques - Sql Loader & External Tables

    Below are 2 techniques using which the data can be loaded from Flat files to oracle tables.
    1)     SQL Loader:
    a.     Place the flat file( .txt or .csv) on the desired Location.
    b.     Create a control file
    Load Data
    Infile "Mytextfile.txt" (-- file containing table data , specify paths correctly, it could be .csv as well)
    Append or Truncate (-- based on requirement) into oracle tablename
    Separated by "," (or the delimiter we use in input file) optionally enclosed by
    (Field1, field2, field3 etc)
    c.     Now run sqlldr utility of oracle on sql command prompt as
    sqlldr username/password .CTL filename
    d.     The data can be verified by selecting the data from the table.
    Select * from oracle_table;
    2)     External Table:
    a.     Place the flat file (.txt or .csv) on the desired location.
    abc.csv
    1,one,first
    2,two,second
    3,three,third
    4,four,fourth
    b.     Create a directory
    create or replace directory ext_dir as '/home/rene/ext_dir'; -- path where the source file is kept
    c.     After granting appropriate permissions to the user, we can create external table like below.
    create table ext_table_csv (
    i Number,
    n Varchar2(20),
    m Varchar2(20)
    organization external (
    type oracle_loader
    default directory ext_dir
    access parameters (
    records delimited by newline
    fields terminated by ','
    missing field values are null
    location ('file.csv')
    reject limit unlimited;
    d.     Verify data by selecting it from the external table now
    select * from ext_table_csv;
    External tables feature is a complement to existing SQL*Loader functionality.
    It allows you to –
    •     Access data in external sources as if it were in a table in the database.
    •     Merge a flat file with an existing table in one statement.
    •     Sort a flat file on the way into a table you want compressed nicely
    •     Do a parallel direct path load -- without splitting up the input file, writing
    Shortcomings:
    •     External tables are read-only.
    •     No data manipulation language (DML) operations or index creation is allowed on an external table.
    Using Sql Loader You can –
    •     Load the data from a stored procedure or trigger (insert is not sqlldr)
    •     Do multi-table inserts
    •     Flow the data through a pipelined plsql function for cleansing/transformation
    Comparison for data loading
    To make the loading operation faster, the degree of parallelism can be set to any number, e.g 4
    So, when you created the external table, the database will divide the file to be read by four processes running in parallel. This parallelism happens automatically, with no additional effort on your part, and is really quite convenient. To parallelize this load using SQL*Loader, you would have had to manually divide your input file into multiple smaller files.
    Conclusion:
    SQL*Loader may be the better choice in data loading situations that require additional indexing of the staging table. However, we can always copy the data from external tables to Oracle Tables using DB links.

    Please let me know your views on this.

  • Help needed in SQL Loader-Urgent..!

    Hi All,
    I am having a staging table with 4 columns, I have to insert
    values in 3 of the columns from a CSV file using SQl Loader( The
    CSV file has only 3 columns in it) and a default value has to be
    inserted in to the 4th column.How can I attain this?? Can I have
    this default
    value logic written in the Control file used for the data insert? If
    yes, Please tell me how..
    Thanks,
    Vidya

    did you refer the doc before posting this question?
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/toc.htm

  • SQL*LOADER and decode

    I'm setting up a sql*loader script and trying to use the decode function as referred to in 'Applying SQL Operators to Fields' I'm getting an error message ' Token longer than max allowable length of 258 chars'. Is there a limit to the size of the decode statement within sql*loader - or is it better to use a table trigger to handle this on insert? I ran the decode statement as a select through SQL*Plus and it works okay there. Oracle 8.0 Utilities shows example of decode in Ch. 5, but Oracle 9i Utilities Ch. 6 does not. Has anyone done this and what's the impact on performance of the load if I can get it to work? See my example below:
    LOAD DATA
    INFILE 'e2e_prod_cust_profile.csv'
    APPEND
    INTO TABLE APPS.RA_CUSTOMER_PROFILES_INTERFACE
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    (Insert_update_flag CHAR(1),
    Orig_system_customer_ref CHAR(240),
    customer_profile_class_name CHAR(30) NULLIF customer_profile_class=BLANKS
    "decode(customer_profile_class_name,
    'NORTHLAND Default','(MIA) Default',
    'NORTHLAND Non Consolidated','(MIA) Non Cons',
    'NORTHLAND Consolidated A','(MIA) Cons A',
    'NORTHLAND Consolidated B','(MIA) Cons B',
    'NORTHLAND Consolidated C','(MIA) Cons C',
    'NORTHLAND Consolidated D','(MIA) Cons D',
    'NORTHLAND Cons A NonZS','(MIA) Cons A NonZS',
    'NORTHLAND Cons B NonZS','(MIA) Cons B NonZS',
    'NORTHLAND Cons C NonZS','(MIA) Cons C NonZS',
    'NORTHLAND Cons D NonZS','(MIA) Cons D NonZS',
    'NORTHLAND International Billing','(MIA) International Billing',
    customer_profile_class_name)",
    credit_hold CHAR(1),
    overall_credit_limit INTERGER EXTERNAL,
    "e2e_cust_profile.ctl" 49 lines, 1855 characters
    SQL*Loader-350: Syntax error at line 15.
    Token longer than max allowable length of 258 chars
    'NORTHLAND Consolidated D','(MIA) Cons D',
    ^

    Your controlfile is incomplete and has some typos, but you could try something like:
    create or replace function decode_profile_class_name (p_longname IN VARCHAR2)
    return VARCHAR2
    is
    begin
      CASE p_longname
        WHEN 'NORTHLAND Default'               THEN RETURN '(MIA) Default';
        WHEN 'NORTHLAND Non Consolidated'      THEN RETURN '(MIA) Non Cons';
        WHEN 'NORTHLAND Consolidated A'        THEN RETURN '(MIA) Cons A';
        WHEN 'NORTHLAND Consolidated B'        THEN RETURN '(MIA) Cons B';
        WHEN 'NORTHLAND Consolidated C'        THEN RETURN '(MIA) Cons C';
        WHEN 'NORTHLAND Consolidated D'        THEN RETURN '(MIA) Cons D';
        WHEN 'NORTHLAND Cons A NonZS'          THEN RETURN '(MIA) Cons A NonZS';
        WHEN 'NORTHLAND Cons B NonZS'          THEN RETURN '(MIA) Cons B NonZS';
        WHEN 'NORTHLAND Cons C NonZS'          THEN RETURN '(MIA) Cons C NonZS';
        WHEN 'NORTHLAND Cons D NonZS'          THEN RETURN '(MIA) Cons D NonZS';
        WHEN 'NORTHLAND International Billing' THEN RETURN '(MIA) International Billing';
        ELSE RETURN p_longname;
      END CASE;
    end;
    LOAD DATA
    INFILE 'e2e_prod_cust_profile.csv'
    APPEND
    INTO TABLE APPS.RA_CUSTOMER_PROFILES_INTERFACE
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    Insert_update_flag          CHAR(1),
    Orig_system_customer_ref    CHAR(240),
    customer_profile_class_name CHAR(30) NULLIF customer_profile_class=BLANKS "decode_profile_class_name(:customer_profile_class_name)"
    credit_hold                 CHAR(1),
    overall_credit_limit        INTEGER EXTERNAL

  • SQL Loader and numeric types

    I'm using SQL Loader to import data from a file, but I'm having trouble with numeric types.
    I'm trying to import an amount into a table. The amount field in the table is of type NUMBER(11,2).
    I suppose that Double is the correct type to use in the ctl-file definition. How do I use this type?
    I've tried to use:
    AMOUNT DOUBLE TERMINATED BY ";" NULLIF BELOP=BLANKS,
    but the I get an error message because I'm using terminated by
    I've also tried using:
    BELOP DOUBLE NULLIF BELOP=BLANKS,
    but then it isn't able to find the delimiter.
    I've tried to search the net for examples using Double, but I haven't found anything of current interest yet.
    So, my question is:
    1. Is Double the correct type to use in this case?
    2. How do I use Double?

    I hardly ever specify a data type in a SQL*Loader control file; I just let Oracle handle it. If it is not the correct datatype for the column Oracle will reject it anyway. The main exception is DATE columns, but even then only because most flat files don't have dates in the default format so the data type specifcation is essentially just a format mask.
    Regards,
    Steve Rooney

  • SQL Loader and control file

    I know I've done this before but, I don't use SQL Loader often and I'm having issues getting a file to load.
    The table has 6 columns in it - one of which is a timestamp.
    I was having issues loading it initially with date format issues. I ruled out any issues with the timestamp format by simply loading a dummy table with some timestamp based data and had no issue.
    So - I think the issue is around the fact that the table I'm loading's first column being a value I'm attempting to default with a sequence when loading and - that I'm screwing up something there.
    Table is as such:
    CREATE TABLE ACS_IPS
        (seq_ips NUMBER,
        col2   VARCHAR2(100),
        col3  VARCHAR2(100),
        col4    VARCHAR2(100),
        col5 TIMESTAMP,
        col6    VARCHAR2(100),
        col7    VARCHAR2(100),
        col8 DATE  DEFAULT SYSDATE NOT NULL,
        col9 VARCHAR2(30) DEFAULT USER);The control file is:
    load data
    truncate
    into table acs_ips
    fields terminated by ","
    trailing nullcols
        seq_ips "seq_ips.nextval",
        col2,
        col3,
        col4,
        col5 TIMESTAMP "YYYY-MM-DD HH24:MI:SS.FF9",
        col6,
        col7
        )The sequence column isn't in the file being loaded... and - there are additional columns that are defaulted on the table that aren't in the control file.
    Any help is appreciated... The error I'm getting is:
    Rejected - Error on table CAMS.ACS_IPS, column ACTION_START.
    ORA-01841: (full) year must be between -4713 and +9999, and not be 0

    Yeah - not sure that clears it up...
    The sequence in my table is the first column - and - I think that's the problem... the sequence is being loaded as the first column in the control file but - it's not in the file being loaded so - it's skewing (again - I think??) the data being read in - which is why I'm getting the timestamp issues on the one column (it's actually reading the next column in the file vs. the actual timestamp one).
    If that's the issue - I'm not sure how to avoid it without restructuring the table to stick the sequence physically at the end. I'm certain that's not necessary and - I'm overlooking something that's otherwise simple but evading me.

  • Sql*loader and sequence() for primary keys

    I have a question regarding SQL*Loader with the sequence() function and using it for a primary key to load records in multiple tables from one input record. I am pulling data from a delimited file and populating several tables from each row. For the primary key, I am using the sequence function.
    For the first table (the parent), I use sequence(40000,1) for the key. Since the remaining inserts are based on the same logical record, I use sequence(40000,1) for those too (one record for each month). The problem comes in when a child record does not pass a WHEN clause (the amount is zero). Then it almost seems as if the parent record is not loaded and the child (or children) that does pass the WHEN clause are assigned to the next parent! Obviously, the sequence is getting out of sync between the children and the parent.
    I've looked in the documentation and tried several different ways to attack this problem. Is there a bug in SQLLDR (8.1.7) or is it just my coding.
    I will try to include the files below but they are very large.
    Thanks for your help.
    Dan
    ***CONTROL FILE***
    LOAD DATA
    INFILE 'rent.csv'
    INTO TABLE BUDGET_LINE
    append
    WHEN TOT_AMT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER CHAR,
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    OCT_AMT          FILLER CHAR,
    OCT_CNT          FILLER CHAR,
    NOV_AMT          FILLER CHAR,
    NOV_CNT          FILLER CHAR,
    DEC_AMT          FILLER CHAR,
    DEC_CNT          FILLER CHAR,
    CUT               FILLER CHAR,
    NETMANGEN          FILLER CHAR,
    NETMAN_item          BOUNDFILLER CHAR,
    NETMAN_item_seq     BOUNDFILLER CHAR,
    NETMAN_location     BOUNDFILLER CHAR,
    UPDATED_ON          DATE "MM/DD/YYYY",
    NETMAN_com_desc     BOUNDFILLER CHAR,
    NETMAN_vendor          BOUNDFILLER CHAR,
    NETMAN_generation     BOUNDFILLER CHAR,
    CREATED_ON          SYSDATE,
    CREATED_BY          CONSTANT '0',
    UPDATED_BY          CONSTANT '0',
    ACTIVE          CONSTANT 'T',
    GL_CODE_COMBO_ID     CONSTANT '0',
    BUDGET_TYPE          CONSTANT 'B',
    AMOUNT_TYPE          CONSTANT 'D',
    source          constant 'N',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    DESCRIPTION          "(:NETMAN_item)||'-'||(:NETMAN_item_seq)||'; '||:NETMAN_com_desc||'; '||:NETMAN_vendor||' ('||:NETMAN_generation||')'"
    INTO TABLE GL_CODE_TEMP
    append
    WHEN TOT_AMT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    SPENDER          CHAR ,
    ACCT               CHAR ,
    TOT_AMT          FILLER CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '1',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '2',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '3',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '4',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '5',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '6',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '7',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '8',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '9',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '10',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '11',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    OCT_AMT          FILLER CHAR,
    OCT_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '12',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    OCT_AMT          FILLER CHAR,
    OCT_CNT          FILLER CHAR,
    NOV_AMT          FILLER CHAR,
    NOV_CNT          FILLER CHAR,
    AMOUNT          CHAR
    *** PIECE OF DATA FILE ***
    Item,Spender,Account,Total Amt,Jan Amt,Jan Count,Feb Amt,Feb Count,Mar Amt,Mar Count,Apr Amt,Apr Count,May Amt,May Count,Jun Amt,Jun Count,Jul Amt,Jul Count,Aug Amt,Aug Count,Sep Amt,Sep Count,Oct Amt,Oct Count,Nov Amt,Nov Count,Dec Amt,Dec Count,Status,Netman Gen,Netman Item,Netman Unit,Location,Last Update Date,Component Description,Vendor Description,Generation Process
    10110993,10993,8301-01,90134,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7667,0,7667,0,0,+,LEASE PYMT,207,WIMOS,5/22/2002,LEASE PAYMENTS,"VIKING HOLDING, INC.",ACTUAL BUDGET
    10410993,10993,8301-04,15240,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,0,+,JANITORIAL,58,WIMOS,5/22/2002,JANITORIAL,BUILDING ONE SVC SOLUTION,ACTUAL BUDGET
    10810993,10993,8301-08,2232,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,0,+,ELECTRIC,77,WIMOS,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",WISCONSIN PUBLIC SERVICE,AVGD 01 04 07 10 NOT WEIGHTED
    10910993,10993,8301-09,4220,26,0,348,0,609,0,383,0,348,0,371,0,348,0,371,0,360,0,348,0,360,0,348,0,0,+,FIRE EQUIP,51,WIMOS,5/22/2002,RENT CONTRACT SERVICES,"CENTRALCOM, INC.",ACTUAL EXPERIENCE
    11610993,10993,8301-16,1272,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,0,+,L/H MOSINE,1,WIMOS,5/22/2002,LEASEHOLD IMPROVEMENTS,ELLIS STONE,ACTUAL BUDGET
    10110994,10994,8301-01,69960,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,0,+,LEASE PYMT,228,WISTEWEL,5/22/2002,LEASE PAYMENTS,BJ INVESTMENTS LLC,ACTUAL BUDGET
    10410994,10994,8301-04,840,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,0,+,JANITORIAL,69,WISTEWEL,5/22/2002,JANITORIAL,MARSDEN,ACTUAL BUDGET
    10710994,10994,8301-07,6067,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6067,0,0,+,LEASE PYMT,228,WISTEWEL,5/22/2002,LEASE PAYMENTS,BJ INVESTMENTS LLC,ASSUME 5% INCREASE OVER ACTUAL 2000 EXPENSES
    10810994,10994,8301-08,2460,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,0,+,ELECTRIC,84,WISTEWEL,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",BJ INVESTMENTS LLC,AVGD 03 06 09 NOT WEIGHTED
    10910994,10994,8301-09,1050,70,0,70,0,105,0,105,0,70,0,105,0,35,0,140,0,35,0,70,0,210,0,35,0,0,+,SANITATION,12,WISTEWEL,5/22/2002,RENT CONTRACT SERVICES,WASTE MANAGEMENT OF WIS,ACTUAL EXPERIENCE
    11910994,10994,8301-19,1099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1099,0,0,0,0,0,0,0,0,0,0,+,INSURANCE,6,WISTEWEL,5/22/2002,INSURANCE,BJ INVESTMENTS LLC,ACTUAL EXPERIENCE
    10110998,10998,8301-01,2440,2440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ACTUAL BUDGET
    10410998,10998,8301-04,146,146,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ACTUAL BUDGET
    10610998,10998,8301-06,336,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,0,+,DRINK H2O,46,ILELG,5/22/2002,COOLER AND BOTTLED WATER,"HINCKLEY & SCHMITT, INC.",AVGD 01 02 03 04 05 06 07 08 09 10
    10710998,10998,8301-07,276,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ASSUME 5% INCREASE OVER ACTUAL 2000 EXPENSES
    10810998,10998,8301-08,3108,433,0,315,0,234,0,173,0,181,0,292,0,320,0,337,0,316,0,153,0,183,0,171,0,0,+,ELECTRIC,20,ILELG,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",COMMONWEALTH EDISON,AVGD 01 02 03 04 05 06 07 08 09 10 WEIGHTED
    *** SCRIPT FOR TABLES LOADED ***
    CREATE TABLE BUDGET_LINE (
    BUDGET_LINE_ID NUMBER NOT NULL,
    BUDGET_TYPE CHAR (1) NOT NULL,
    GL_CODE_COMBO_ID NUMBER NOT NULL,
    AMOUNT_TYPE CHAR (1) NOT NULL,
    ACTIVE CHAR (1) DEFAULT 'T' NOT NULL,
    SOURCE CHAR (1),
    CUT CHAR (1),
    DESCRIPTION VARCHAR2 (180),
    CAP_ITEM_ID NUMBER,
    PBT_ID NUMBER,
    BILL_ID NUMBER,
    CREATED_ON DATE DEFAULT SYSDATE NOT NULL,
    CREATED_BY NUMBER NOT NULL,
    UPDATED_ON DATE DEFAULT SYSDATE NOT NULL,
    UPDATED_BY NUMBER NOT NULL,
    CHECK (ACTIVE IN ('T','F') ) ,
    CHECK (CUT IN ('C',NULL) ),
    CONSTRAINT BUDGET_LINE_PRI
    PRIMARY KEY ( BUDGET_LINE_ID ) ) ;
    CREATE TABLE BUDGET_COST (
    BUDGET_LINE_ID NUMBER NOT NULL,
    PERIOD_ID NUMBER NOT NULL,
    AMOUNT NUMBER (13,2),
    CONSTRAINT BUDGET_COST_PRI
    PRIMARY KEY ( BUDGET_LINE_ID, PERIOD_ID ) ) ;
    CREATE TABLE GL_CODE_TEMP (
    BUDGET_LINE_ID NUMBER NOT NULL,
    SPENDER CHAR (5),
    ACCT CHAR (7),
    GL_CODE_COMBO_ID NUMBER,
    CONSTRAINT GL_CODE_TEMP_BDGT_ID
    PRIMARY KEY ( BUDGET_LINE_ID ) ) ;

    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 and bulk data

    hi,
    I want to insert 100,000 records daily in a table for the first month and then in next month these records are going to be replaced by new updated records.
    there might be few addition and deletion in the previous records also.
    actually its consumer data so there might be few consumer who have withdrawn the utility and there will be some more consumer added in the database.
    but almost 99% of the previous month data have to be updated/replaced with the fresh month data.
    For instance, what i have in my mind is that i will use sql loader to load data for the first month and then i will delete the previous data using sqlPlus and load the fresh month data using sql loader again.
    1. Is this ok ? or there is some better solution to this.
    2. I have heard of external files, are they feasible in my scenario?
    3. I have planned that i will make scripts for sqlPlus and Loader and use them in batch files. (OS windows 2003 server, Oracle 9i database). is there some better choice to make all the procedure automatic?
    looking for your suggestions
    nadeem ameer

    I would suggest u use External tables since its more flexible then
    sqlloader & is a better option.
    For using external tables
    1)u will have to create a directory first
    2)Generally creation od directory is done by sys,hence after creating the directory
    privileges read & write to be provided to user .
    3)Creation of external tables.
    4) Now use the table as a normal table to insert ,update delete in
    ur table.
    U can get more information from
    http://www.oracle-base.com/articles/9i/SQLNewFeatures9i.php#ExternalTables
    Create Directory <directory_name> as <Directory path where file be present>
    Grant read,write on directory <directory_name> to <username>
    CREATE TABLE <table_name>
    (<column names>)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY ,directory_name>
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    LOCATION (<filename>)
    PARALLEL 5
    REJECT LIMIT 200;
    Hope this helps.

Maybe you are looking for

  • Insufficient Authorization error while creating objets in IR

    Hi all, I have logged in IR with admin user , The user has all the roles(developer and sld). But still while creating any namespace or other design objects it gives the below error- Insufficient authorization to create objects ............ I have gon

  • I can not download anythign with firefox.

    When I right click and save to a folder the file will appear in the download manager and appears to download, but when I try to find the file in the folder its not there, and when I right click on the file in the download manager the "open file" and

  • Southern California FIOS excessive hopping (BAD LAG)

    Ive called fios about this issue multiple times and they have still yet to fix anything. Is 25 hops to google normal? Is routing me across the country( sometimes multiple times back and fourth) efficient? This issue is killing my online gaming. Veriz

  • Filling OLAP Cache for 3 Bex queries

    Dear Experts, Here, We would required to fill the OLAP cache for four bex queries using the Broadcaster Settings. can any one please suggest for the following. how to schedule the OLAP chache filling for 3 different queries at a time. do we need to p

  • Cannot sign in to iCloud from system preference

    When I try to set up iCloud through the System Preferences pane using my Apple ID and password, I get the following message: "You can't sign in at this time". I could successfully set-up iCloud on my iPhone and can also sign in via icloud.com. I have