Update/Add data to a table to CSV

Hi Experts,
I am very new to Oracle. I have a scenario where I get a CSV posted in a folder every day. I need to download the same on a table, the csv file may have already existing records which we might want to put up-to-date and also new records, which must be inserted recently. Can someone suggest a best practice for this. IM open to use Perl/Shell scripts. Please let me know.

Thank you
Knockaert

Welcome to the forum!

Assuming that the file is on the database server...
Then, you can use an external table and a single MERGE statement to load data from the file.

Tags: Database

Similar Questions

  • How to add data to the table?

    Hello

    As it is in question. Can I add data (new items) in table dynamically? I say my table 1 d is size 3, but I would like to add three items. Should I change size table first?

    See you soon,.

    K

    Hi K,

    Ray is right!

    Maybe this thread will also help you because there are examples of smal

    http://forums.NI.com/NI/board/message?board.ID=330&message.ID=18421&query.ID=288653#M18421

    Concerning

    Jürgen

  • How to add data to the table changed in sql developer at Apex and vice versa

    Hello

    I had tables of database with sql developer. But now, I have modified the database (new tables added + changed the data in the tables). However, in the Apex, I the old database. Is it possible to get the new Apex database with the data of the table changed so this database in both places (sql and apex developer) is exactly the same... Also the other way around.

    Thank you

    The database schema that contains the tables, is it associated with the workspace even you are searching through the APEX product t development?  Why I'm asking is, if they are the same schema, the tables that you MODIFIED should be appear in the sql for APEX workshop part.  Now reports and forms will NOT see the changes (unless you have actually added or updated definitions for column).

    Can you explain what exactly you were doing the SQL Developer to the tables in your schema?

    Thank you

    Tony Miller
    Los Alamos, NM

  • How to add data to the table using Manager POST for restful Apex application

    Hi all

    I managed to create a service application web Manager restful using GET for the Restful service module. I am able to get the data in row on the presentation of a table row id in the application. But I can't find an appropriate example, how the new data in the table can be posted or deleted. I created a POST handler for a URI scheme and look forward on how to proceed. Any help would be really appreciated.

    Source for the POST Manager:

    Start

    insert into ALL_BOOKS values(:id,:book);

    end;

    Also created 2 parameters id and the book.

    Hi jerry2134,

    jerry2134 wrote:

    I managed to create a service application web Manager restful using GET for the Restful service module. I am able to get the data in row on the presentation of a table row id in the application. But I can't find an appropriate example, how the new data in the table can be posted or deleted. I created a POST handler for a URI scheme and look forward on how to proceed. Any help would be really appreciated.

    Source for the POST Manager:

    Start

    insert into ALL_BOOKS values(:id,:book);

    end;

    Also created 2 parameters id and the book.

    Check out the following tutorials OBE, that explains the creation of GET and POST RESTful Web Services and how to use them in the APEX.

    Also what yo mean "looking forward on how to proceed? Do you want to or created for use/consume in your Oracle APEX application hosted RESTful web services?

    If Yes, in your Application, you must create a RESTful Web Service reference -> shared components. Then, create a form/report based on Web Service reference.

    Kind regards

    Kiran

  • Insert and add data to the table to a batch file

    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE Production 11.1.0.7.0
    AMT for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production


    My patch to input file looks like this:

    A0397990002000001
    A0459380377000075
    A1291115796000002
    C0483110026000080
    D0491114923000004
    A0348400660000000
    G0209111373-

    Separate columns look like this:

    A0397 990002 000001

    account amount of IDN


    I'm new to PL/SQL and having a problem changing or adding a record in a table. Don't know how to check if a record exists in the table change if not
    Insert the record.

    If the quantity is 000000 or - the record should be deleted. I have code in place to do this however, don't know how to handle change or add the part.

    Here is the code I have so far and thanks for looking:

    Set serveroutput on
    create or replace directory user_dir as 'c:\dataformats\incoming\ ';


    DECLARE


    v_filename VARCHAR2 (100); -The name of the data file
    v_file_exists boolean;
    number of v_file_length;
    number of v_block_size;
    f utl_file.file_type;
    s varchar2 (200);
    lineString varchar (200);

    -not used c_ *.
    c_account ID_REQ_STG.account%TYPE;
    c_IDN ID_REQ_STG. IDN % TYPE;
    c_quantity ID_REQ_STG.quantity%TYPE;

    ID_REQ_TUPLE ID_REQ_STG % ROWTYPE;

    v_account varchar (5);
    v_IDN varchar (6);
    V_quantity varchar (6);

    BEGIN
    v_filename: = ' PTCLICK. MANUAL.12SERIES.TXT';


    DBMS_OUTPUT. Put_line (v_filename); -the name of the file


    UTL_FILE.fgetattr ("USER_DIR", v_filename, v_file_exists, v_file_length, v_block_size);

    IF v_file_exists THEN

    dbms_output.put_line ("'File Exists");

    f: = utl_file.fopen ("USER_DIR", v_filename, "R");

    IF utl_file.is_open (f) THEN

    LOOP
    BEGIN
    UTL_FILE.get_line (f, s);
    lineString: = s;

    dbms_output.put_line (lineString);

    v_account: = substr (lineString, 1, 5);
    v_IDN: = substr (lineString, 6, 6);
    V_quantity: = substr (lineString, 12.6);


    dbms_output.put_line (v_account);
    dbms_output.put_line (v_IDN);
    dbms_output.put_line (V_quantity);

    -REMOVE

    IF v_quantity = '000000' GOLD v_quantity = '-'
    THEN
    REMOVE FROM ID_REQ_STG
    WHERE account = v_account and
    IDN = v_IDN;
    commit;
    dbms_output.put_line ('Deleted the folder' | v_account |) «and» | v_IDN);
    END IF;


    -CHANGE



    -ADD



    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    dbms_output.put_line ("' no data found");
    EXIT;
    END;

    END LOOP;

    END IF; -is open

    UTL_FILE.fclose (f);


    ON THE OTHER

    dbms_output.put_line ('file does not exist');

    END IF; -file exists

    EXCEPTION

    WHEN UTL_FILE. THEN ACCESS_DENIED
    DBMS_OUTPUT. Put_line ("' no access!");
    WHEN UTL_FILE. INVALID_PATH THEN
    DBMS_OUTPUT. PUT_LINE ('PATH DOES NOT EXIST');
    WHILE others THEN
    DBMS_OUTPUT. PUT_LINE ("SQLERRM: ' |") SQLERRM);



    END;
    /

    Hello

    Looks like a good candidate for a MERGER with an external table.

    The external table:

    create table ext_table (
     account varchar2(5),
     idn number(6),
     quantity varchar2(6)
    )
    organization external (
      type oracle_loader
      default directory user_dir
      access parameters (
        records delimited by newline
        fields (
          account position(1:5) char(5),
          idn position(6:11) char(6),
          quantity position(12:17) char(6)
        )
      )
      location ('test.txt')
    )
    reject limit unlimited;
    

    Then a simple MERGER should perform all your needs:

    MERGE INTO id_req_stg t
    USING (
     SELECT account,
            idn,
            decode(quantity, '-', 0, to_number(quantity)) as quantity
     FROM ext_table
    ) v
    ON ( t.account = v.account AND t.idn = v.idn )
    WHEN MATCHED THEN
      UPDATE SET t.quantity = v.quantity
      DELETE WHERE t.quantity = 0
    WHEN NOT MATCHED THEN
      INSERT (account, idn, quantity)
      VALUES (v.account, v.idn, v.quantity);
    

    Documentation related to the MERGER: http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_9016.htm#SQLRF01606
    and on the outdoor tables: http://download.oracle.com/docs/cd/E11882_01/server.112/e10595/tables013.htm#ADMIN12896

    Published by: odie_63 on June 10, 2010 14:26 (added docs)

  • update of data from another table

    Hi, I would like to help. I Don t know how I can start doing:


    I have a table with a column with numbers (primary key) and I need to create another column with the same values,


    I want to change a table that has only numeric values (PK) to another
    value, so I disable the constraints of linked tables
    then I create another column that I called the "d" column and copy the values
    from column A to column D

    For example.

    TABLE XYZ

    COLUMN A: COLUMN D: (NEW)

    00001 00001
    00002-00002
    00003-00003
    00004 00004


    Can I change the values in column A and D of the column will be kept

    TABLE XYZ
    COLUMN A: COLUMN D:

    00001 99901
    99902 00002
    99903 00003
    99904-00004


    As the tables that must "point" to the column, I change the values with the new numbering

    TABLE ZZZZ

    COLUMN B: (the values of the column before the change)

    00001
    00002
    00003
    00004
    ...

    I want it like this:

    99901
    99902
    99903
    99903
    99904
    ...


    In other words, I find the current value in column D of the XYZ table for the new value that is in column a.



    I appreciate the help! :)

    Try this
    Here you will find a record in test1 for a record for each line of teste2 in teste2 joined the condition t1.numer_documento2 = t2.numero_documento.

    This is called as subquery related Co. What you were doing was under queries that and not to join the top request.

    UPDATE teste2  t2 SET NUMERO_DOCUMENTO =
    (SELECT T1.NUMERO_DOCUMENTO
      FROM teste1 t1
      WHERE t1.numer_documento2 = t2.numero_documento
      and ROWNUM = 1 )
    
    -- "Check/Select your data before you commit "
    

    SS

  • Need to add data to the tables in the target

    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production

    Hi gurus

    Need your help again, I have the following data.

    Sample data

    create the table parent_mst

    (

    GRP number (3).

    nel number 4

    );

    create the table parent_dtl

    (

    GRP number (3).

    by number 4

    );

    Query

    with pp as

    (

    Select double union 100 grp, nel 8000

    Select grp 200, nel 7000 double

    ),

    As CC

    (

    Select grp 100, 200 per Union double all the

    Select grp 100, 300 per Union double all the

    Select grp 100, 400 per Union double all the

    Select grp 200, 400 by double

    )

    Select *.

    pp p, cc c

    where p.grp = c.grp;

    -Result of the query

    GRP, NEL, GRP_1, BY

    1008000100200
    1008000100300
    1008000100400
    2007000200400

    Now, I want to insert the following data into the parent_mst table.

    Need to insert the following data in parent_mst using all of the above data

    GRP nel

    100 8000

    200 7000

    Need to insert the following data in parent_dtl using all of the above data

    GRP BY

    100 200

    100 300

    100 400

    200 400

    Please guide. Thank you

    Concerning

    Shu

    Check if it works:

    INSERT INTO parent_mst
       (SELECT p.grp, p.nel, p_seq.NEXTVAL
          FROM parents p
         WHERE p.grp IN (SELECT grp FROM childs));
    
    INSERT INTO parent_dtl
       (SELECT c.grp, c.per, DENSE_RANK () OVER (PARTITION BY 1 ORDER BY c.grp)
          FROM childs c
         WHERE c.grp IN (SELECT grp FROM parents));
    
    COMMIT;
    

    See you soon,.

    Manik.

  • Dynamically add data to a table field in a drop-down list?

    Hello

    I tried to create a drop down menu to dynamically fill a table based on what menu option drop down is selected. I can run to add a line to the times, which is good, but I want to add the text for the option chosen to a field in the newly created line. I can get this to work using Row1.Field.rawValue = "blah blah blah" but when I want to get dynamic and call the line created by using something like resolveNode I can't get anything to be entered in the field. Is this possible at all?

    Here is my script:

    ==================

    topmostSubform.Page1.tabletest.DropDownList2::exit - (JavaScript, client)

    If (this.rawValue == 1) {}

    Table4._Row1.addInstance)

    Page1.tabletest.Table4.Row1.identity.RawValue = 'Servitude for Transmission line.

    };

    If (this.rawValue == 2) {}

    Table4._Row1.addInstance)

    Page1.tabletest.Table4.resolveNode(row1[Table4.row1.instanceManager.Count-1]). Identity.RA wValue = ' Servitude for electricity and other purposes.

    xfa.host.messageBox ("Ausgrid");

    };

    ===================

    The first part, for this.rawValue is 1 good works for a single instance of the addition. The second part, where I tried to do a resolveNode, adds a line, but does not enter any text.

    Thanks in advance for your assistance with and review of this problem.

    See you soon,.

    Greig

    poulate_table_dynamically_from_drop_down.jpg

    Hello

    the resolveNode method must somExpressions wrapped in quotes.

    In front of FormCalc JavaScript does not support numeric values in the [] accessors to solve a case.

    Modify your script

    Page1.tabletest.Table4.resolveNode("Row1[" + Table4.Row1.instanceManager.count-1 + "]").Identity.rawValue = ...
    
  • update of the data in the table

    create or replace procedure SP_MIS_LEDGER_ON_DEMAND_V2
    as

    date of var_date1;

    DATE OF VAR_STARTDATETIME;
    DATE OF VAR_ENDDATETIME;
    -VAR_EXECUTE_FOR_DATE DATE;
    -VAR_STATEMENT VARCHAR2 (4000);
    VAR_ELAPSEDTIME VARCHAR2 (50);
    NUMBER OF VAR_INTRIMSTATUSID;

    CURSOR c1 IS
    SELECT DISTINCT ta.accountid, PROCESSDATE, (NVL(payment,0)) PAYMENT, TOTALDUE day 0, CURBILL 0, NVL (srf, 0) SRF, NVL (sbpnt, 0) sbpnt, NVL (srv, 0) SRV, NVL (sbf, 0) SBF, NVL (SBV, 0) SBV, NVL (EF, 0) EF, NVL (EV, 0) EV, NVL (TSRV, 0) TSRV, NVL (tsub, 0) TSUB, NVL (teqe, 0) TEQE, NVL (DT, 0) DT, NVL (A.dep, 0) RDEP , NVL (B.DEP, 0) PAPD, NVL (pnt, 0) PNT, NVL (eqp, 0) EQP, NVL (dB, 0) DTR, NVL (WA, 0) WA, NVL (dice, 0) OF a
    (select day SEPARATE, accountid)
    Of
    syntblmaccount, tblmtime, where yyyy = 2010) your,.
    (SELECT accountid,
    The SUM (srfee) CRS.
    SRV SUM (srvat),
    SBF SUM (subfee),
    SBV SUM (subvat),
    SUM EF (eqefee),
    SUM EV (eqevat),
    Tsrv, SUM (ttlsrv),
    Tsub SUM (ttlsub),
    Teqe SUM (ttleqe),
    SUM (dep) the dep,
    SUM (dt) dt, trunc (FROMDATE) FROMDATE
    OF VWDT_V6
    Accountid group, trunc (FROMDATE)
    ),
    (SELECT accountid,
    TNP (TNP) SUM,
    SUM (subpnt) sbpnt,
    EQP SUM (eqpnt),
    SUM (dep) the dep,
    SUM DTR (DEPTRANSFER),
    DRF SUM (DEPREFUNDED),
    SUM (dice) of PaymentData trunc (PaymentData)
    OF vwkt_v4
    GROUP BY accountid, trunc (paymentdate)
    ) b.
    (SELECT ACCOUNTID accountid, TRUNC (createdate) CREATEDATE, PAYMENT of a SUM of (amount)
    of syntbltcreditdocument
    where CREDITDOCUMENTTYPEID IN ('CDT01', 'CDT04')
    credit group by accountid, TRUNC (createdate))
    where your .accountid = a.accountid (+)
    and your .accountid = b.accountid (+)
    and your .accountid = credit.accountid (+)
    and your .day = a.FROMDATE (+)
    and your .day = credit.createdate (+)
    and your .day = b.paymentdate (+)
    and ta.day = to_date('01-MAY-2010','DD-MON-YYYY');

    BEGIN

    SELECT MAX (PROCESSDATE) IN THE VAR_DATE1 OF MIS_LEDGER_DETAIL_TEST;

    SELECT SYSDATE INTO VAR_STARTDATETIME FROM DUAL;

    SELECT SEQ_PRC_STATUS. NEXTVAL INTO VAR_INTRIMSTATUSID FROM DUAL;

    C1_rec IN C1
    LOOP
    OUTPUT WHEN c1% NOTFOUND;

    MIS_LEDGER_DETAIL_tEST update
    A.PAYMENT = c1_rec.payment, VALUE
    A.TOTALDUE is c1_rec. TOTALDUE,
    A.CURBILL is c1_rec. CURBILL,
    A.SRF = c1_rec.srf,
    A.SBPNT = c1_rec.sbpnt,
    A.SRV = c1_rec. SRV,
    A.SBF = c1_rec. SBF,
    A.SBV = c1_rec. SBV,
    A.EF = c1_rec. EF,
    A.EV = c1_rec.ev,
    A.TSRV = c1_rec.tsrv,
    A.TSUB = c1_rec.tsub,
    A.TEQE = c1_rec. Teqe,
    A.DT = c1_rec. DT,
    A.PDEP is c1_rec. PAPD,
    A.RDEP IS C1_REC. RDEP,
    A.PNT = c1_rec. PNT,
    A.EQP = c1_rec. EQP,
    A.DTR = c1_rec. DTR,
    A.DRF = c1_rec. WA,
    A.UNADJ = c1_rec.unadj
    where A.accountid = c1_rec.accountid
    and A.processdate = C1_REC.processdate
    and a.processdate = to_date('01-MAY-2010','DD-MON-YYYY');

    END LOOP;

    commit;
    SELECT SYSDATE INTO VAR_ENDDATETIME FROM DUAL;


    SELECT CAST (VAR_ENDDATETIME AS TIMESTAMP).
    CAST (VAR_STARTDATETIME AS TIMESTAMP) VAR_ELAPSEDTIME
    FROM DUAL;

    INSERT INTO LedgerStatusSummary (StatusID, procedurename, STARTDATETIME, ENDDATETIME, LastExecutionDate, NextExecutionDate, LastModifiedDate, TIMETAKEN, Procedurestatus) VALUES
    (VAR_INTRIMSTATUSID, "SP_MIS_LEDGER_ON_DEMAND", VAR_STARTDATETIME, VAR_ENDDATETIME, TRUNC (VAR_DATE1), TRUNC (VAR_DATE1) + 1, VAR_STARTDATETIME, VAR_ELAPSEDTIME, "MENUAL");

    COMMIT;

    EXCEPTION
    WHILE OTHERS
    THEN DBMS_OUTPUT. Put_line ("an error has occurred - ' |") SQLCODE |' - ERROR - ' | SQLERRM);


    END SP_MIS_LEDGER_ON_DEMAND_V2;


    I 9830 data MIS_LEDGER_DETAIL_tEST table... I update of data in the table, but it takes more time to update for TI 01-May-2010 not complete execution in 15 minutes so I abort it...



    How to write queries to update...? Please guide me...

    Thanks in advance

    exec SP_MIS_LEDGER_ON_DEMAND_V2

    Cursor for loops have been obsolete in Oracle for this entire decade and well in the past: over 12 years now. Why are you writing?

    http://www.morganslibrary.org/reference/array_processing.html


    Why did someone write code Oracle 8.0 in 2010?

  • Display and update of fields in different tables on the same page.

    I am facing two problems...

    (1) I have a report on which I show several fields of 4 different tables. For each row of data, there is a link to change on the first column. By clicking on the link change, I show you a form where I want to show the respective data. On the link change, even if I send you the data in the report, they do not appear on the form (what edit link is clicked). Also, there is only room for 3 items to ship through the link change.
    How to display the data correctly on the form? Is there another way to use the link change?

    (2) on the form, how do I update the data from different tables?

    Thank you

    Gargi

    Hi Lisa,

    The text of presentation on the INSTEAD OF triggers is in: [http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm#sthref7918]

    First of all, your SQL View contains a unique key so that your triggers and the two Apex know what is updated.

    Then, you can create instead of triggers for "instead of INSERT ON viewname", 'instead of UPDATE ON viewname' and 'DELETE ON viewname' on your SQL view. What do these triggers depends on what you need. In the trigger code, you refer to new data using: NEW.column_name and old data using: OLD.column_name (updates both: OLD and: NEW values).

    I'm not sure of the SEPARATE, the GROUP IN question. You would certainly have a unique key on each record. It could be that the DISTINCT or GROUP BY clause will have to be taken out of the SQL view and is part of the source of the region, so that the SQL view does nothing with the data other than to join several tables in a single "table" from the Primary Key/Foreign Key relationship.

    Andy

  • Update of data based on records in another table

    I have 2 tables

    Table 1
    Name Date of article
    Jon apples 2013/06/11 00:30:00 hrs
    Sam Oranges
    NISH apples

    Table 2 - Net number
    Number of name components
    NISH apples 10
    NISH Oranges 17
    NISH banana
    Sam 10 apples
    Sam Oranges 1
    Sam bananas 1
    Jon potatoes 8

    I need to create a job that checks the table 1 for new records added after the last race and then add the count in table 2 accordingly.
    Please guide on how to do this using the PL/SQl or something similar

    You need a third table where you store the time stamp of the last execution or an additional field in table 1 which indicates if a record has been processed already. (or the Date column has this information?).

    Then he must know if all possible combinations of the name and are already in Table2. If so, a simple update would do the job. If this isn't the case, you should take a look at the merge statement:

    http://docs.Oracle.com/CD/B28359_01/server.111/b28286/statements_9016.htm

    Good bye

    DPT

  • Select the data in a table and update in another table

    Dear experts,

    create the table TB_ENCRYPT

    (

    Identification number,

    Varchar2 (200) KEY

    );

    INSERT INTO TB_ENCRYPT VALUES(1,'HJUVHDUIFBSDGVU');

    SELECT * FROM TB_ENCRYPT;

    1 HJUVHDUIFBSDGVU

    create TABLE users)

    username, NUMBER of

    password VARCHAR2 (200)

    );

    Insert users

    values (1, 123 # "")

    Insert users

    values (2, 456 #')

    Select * from users;

    1 123 #.

    # 2 456

    I want to select the data KEY for table TB_ENCRYPT column and update in the column of tables for the respective key user password

    TB_ENCRYPT table contains only a single key value. Comparing this key, I want to update the old value of the key to the new value.

    For encryption and decryption I followed the java class method.no is worried about that.

    create or replace

    PACKAGE PCK_ENC AUTHID CURRENT_USER AS

    FUNCTION DECRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.decrypt (java.lang.String, java.lang.String) return java.lang.String ';

    FUNCTION ENCRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.encrypt (java.lang.String, java.lang.String) return java.lang.String ';

    END;

    SELECT PCK_ENC. ENCRYPT('1234','HJUVHDUIFBSDGVU') FROM DUAL;

    HERE,

    1234 - is the password of the users table column data

    HJUVHDUIFBSDGVU - represents the key of table TB_ENCRYPT column data.

    Comparing this key, I want to update the old value of the key to the new value.

    I tried with this method

    declare

    cursor c1 is

    Select the key

    of TB_ENCRYPT

    where id = 1

    update the id;

    Start

    for c1_rec looping c1

    update users

    password is PCK_ENC. Encrypt (Password, Key)

    the location being c1;

    commit;

    end loop;

    end;

    /

    Help, please

    You can use the MERGE statement.

    merge into users
    using tb_encrypt
       on (id = userid)
      when matched then
          update set password = PCK_ENC.ENCRYPT(password,key);
    

    And why you encrypt your password. This isn't a good idea. Just password hash.

  • SQL Loader loading data into two Tables using a single CSV file

    Dear all,

    I have a requirement where in I need to load the data into 2 tables using a simple csv file.

    So I wrote the following control file. But it loads only the first table and also there nothing in the debug log file.

    Please suggest how to achieve this.

    Examples of data

    Source_system_code,Record_type,Source_System_Vendor_number,$vendor_name,Vendor_site_code,Address_line1,Address_line2,Address_line3

    Victor, New, Ven001, Vinay, Vin001, abc, def, xyz

    Control file script

    ================

    OPTIONS (errors = 0, skip = 1)
    load data
    replace
    in the table1 table:
    fields ended by ',' optionally surrounded "" "
    (
    Char Source_system_code (1) POSITION "ltrim (rtrim (:Source_system_code)),"
    Record_type tank "ltrim (rtrim (:Record_type)),"
    Source_System_Vendor_number tank "ltrim (rtrim (:Source_System_Vendor_number)),"
    $vendor_name tank "ltrim (rtrim (:Vendor_name)),"
    )
    in the Table2 table
    1 = 1
    fields ended by ',' optionally surrounded "" "
    (
    $vendor_name tank "ltrim (rtrim (:Vendor_name)),"
    Vendor_site_code tank "ltrim (rtrim (:Vendor_site_code)),"
    Address_line1 tank "ltrim (rtrim (:Address_line1)),"
    Address_line2 tank "ltrim (rtrim (:Address_line2)),"
    Address_line3 tank "ltrim (rtrim (:Address_line3)).
    )

    the problem here is loading into a table, only the first. (Table 1)

    Please guide me.

    Thank you

    Kumar

    When you do not provide a starting position for the first field in table2, it starts with the following after a last referenced in table1 field, then it starts with vendor_site_code, instead of $vendor_name.  So what you need to do instead, is specify position (1) to the first field in table2 and use the fields to fill.  In addition, he dislikes when 1 = 1, and he didn't need anyway.  See the example including the corrected below control file.

    Scott@orcl12c > test.dat TYPE of HOST

    Source_system_code, Record_type, Source_System_Vendor_number, $vendor_name, Vendor_site_code, Address_line1, Address_line2, Address_line3

    Victor, New, Ven001, Vinay, Vin001, abc, def, xyz

    Scott@orcl12c > test.ctl TYPE of HOST

    OPTIONS (errors = 0, skip = 1)

    load data

    replace

    in the table1 table:

    fields ended by ',' optionally surrounded "" "

    (

    Char Source_system_code (1) POSITION "ltrim (rtrim (:Source_system_code)),"

    Record_type tank "ltrim (rtrim (:Record_type)),"

    Source_System_Vendor_number tank "ltrim (rtrim (:Source_System_Vendor_number)),"

    $vendor_name tank "ltrim (rtrim (:Vendor_name)).

    )

    in the Table2 table

    fields ended by ',' optionally surrounded "" "

    (

    source_system_code FILL (1) POSITION.

    record_type FILLING,

    source_system_vendor_number FILLING,

    $vendor_name tank "ltrim (rtrim (:Vendor_name)),"

    Vendor_site_code tank "ltrim (rtrim (:Vendor_site_code)),"

    Address_line1 tank "ltrim (rtrim (:Address_line1)),"

    Address_line2 tank "ltrim (rtrim (:Address_line2)),"

    Address_line3 tank "ltrim (rtrim (:Address_line3)).

    )

    Scott@orcl12c > CREATE TABLE table1:

    2 (Source_system_code VARCHAR2 (13),)

    3 Record_type VARCHAR2 (11),

    4 Source_System_Vendor_number VARCHAR2 (27),

    5 $vendor_name VARCHAR2 (11))

    6.

    Table created.

    Scott@orcl12c > CREATE TABLE table2

    2 ($vendor_name VARCHAR2 (11),)

    3 Vendor_site_code VARCHAR2 (16).

    4 Address_line1 VARCHAR2 (13),

    5 Address_line2 VARCHAR2 (13),

    Address_line3 6 VARCHAR2 (13))

    7.

    Table created.

    Scott@orcl12c > HOST SQLLDR scott/tiger CONTROL = test.ctl DATA = test.dat LOG = test.log

    SQL * Loader: release 12.1.0.1.0 - Production on Thu Mar 26 01:43:30 2015

    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

    Path used: classics

    Commit the point reached - the number of logical records 1

    TABLE1 table:

    1 row loaded successfully.

    Table TABLE2:

    1 row loaded successfully.

    Check the log file:

    test.log

    For more information on the charge.

    Scott@orcl12c > SELECT * FROM table1

    2.

    RECORD_TYPE SOURCE_SYSTEM_VENDOR_NUMBER $VENDOR_NAME SOURCE_SYSTEM

    ------------- ----------- --------------------------- -----------

    Victor Ven001 new Vinay

    1 selected line.

    Scott@orcl12c > SELECT * FROM table2

    2.

    $VENDOR_NAME VENDOR_SITE_CODE ADDRESS_LINE1 ADDRESS_LINE2 ADDRESS_LINE3

    ----------- ---------------- ------------- ------------- -------------

    Vinay Vin001 abc def xyz

    1 selected line.

    Scott@orcl12c >

  • How can I add data file to an existing table on Oracle RAC ASM with no OMF? Thank you!

    How can I add data file to an existing table on Oracle RAC ASM with no OMF? Thank you!

    Hello

    So I guess you have some files in ASM, see your first existing file structure

    Select file_name

    from dba_data_files;

    and to add to an existing table, the example below (even if you're better sticking with OMFs!)-is that what you are looking for?

    SQL > create tablespace TEST1

    2 datafile '+ DATA' size 1 M;

    Created tablespace.

    SQL > select file_name in dba_data_files;

    FILE_NAME

    --------------------------------------------------------------------------------

    +Data/orcl2/datafile/users.259.859820983

    +Data/orcl2/datafile/undotbs1.258.859820983

    +Data/orcl2/datafile/SYSAUX.257.859820983

    +Data/orcl2/datafile/system.256.859820981

    +Data/orcl2/datafile/example.269.859821049

    +Data/orcl2/datafile/Test1.271.859843053

    6 selected lines.

    SQL > alter tablespace TEST1

    2 Add datafile ' + DATA / mynewfile01.dbf ' size 2 m;

    Tablespace altered.

    SQL > select file_name in dba_data_files;

    FILE_NAME

    --------------------------------------------------------------------------------

    +Data/orcl2/datafile/users.259.859820983

    +Data/orcl2/datafile/undotbs1.258.859820983

    +Data/orcl2/datafile/SYSAUX.257.859820983

    +Data/orcl2/datafile/system.256.859820981

    +Data/orcl2/datafile/example.269.859821049

    +Data/orcl2/datafile/Test1.271.859843053

    + DATA / mynewfile01.dbf

    Thank you

  • How can I update the date cancellation in usr table IOM

    Hello

    I wrote a process task adapter which will return a date. I want to map this date with Deprovisioning return date to the table of the USR.

    While you map this date of return to definition by the user, I don't see the option 'Date of Deprovisioning' playoff from the drop-down list.

    So how can I map this date back to the date of cancellation?

    Basically I want to update USR_DEPROVISIONING_DATE with the date of return of my adapter to process task?

    Pls suggest.

    Thank you

    It may be useful

    Unable to update the dates of start/end with updateUser API

Maybe you are looking for