Multiple record insertion

Hi
I already raised this question longtime back but i havenot recieved any replies. following is the query.
In my aaplication i want to insert an approximate of 20000 records for a single transaction. Is there any special method to insert this records fastly. My application is an web application with MS SQL server as backend.
Thanks.

As mentioned before it is almost always better to use the tools that come with your DB to do major data importing/exporting.
For MS-SQL that would be BCP (which is a command line util that ships with the server and you could launch it as a process from within Java if you so wished)
http://www.databasejournal.com/features/mssql/article.php/3391761

Similar Messages

  • Alv report for multiple record insertion

    hi,
    i'm new to abap. i'm using alv report for record display and insertion. how can i insert multiple records from alv to my table??

    well that can be achieved only by running BDC inside alv report to enter the entries.and in that too you can append or edit single entries only
    reward if useful
    regards
    vivek

  • RFC to JDBC Scenario: Multiple Records insertion

    Hi All,
    I am working with RFC->XI->JDBC to update a single table on an Oracle db.
    When I import RFC I get multiple Records.
    Here is the sender XML Structure:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:Z_I2_SAP2MDM_VM xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    + <I_LFA1>
      </I_LFA1>
      <T_XLFAT />
    - <T_XWYT3>
    - <item>
      <MANDT>800</MANDT>
      <LIFNR>0000009962</LIFNR>
      <EKORG>1000</EKORG>
      <LTSNR />
      <WERKS />
      <PARVW>LF</PARVW>
      <PARZA>000</PARZA>
      <ERNAM>ARUCHI</ERNAM>
      <ERDAT>2006-05-26</ERDAT>
      <LIFN2>0000009962</LIFN2>
      <DEFPA />
      <PERNR>00000000</PERNR>
      <PARNR>0000000000</PARNR>
      <KZ>I</KZ>
      </item>
    - <item>
      <MANDT>800</MANDT>
      <LIFNR>0000009962</LIFNR>
      <EKORG>1000</EKORG>
      <LTSNR />
      <WERKS />
      <PARVW>RS</PARVW>
      <PARZA>001</PARZA>
      <ERNAM>ARUCHI</ERNAM>
      <ERDAT>2006-05-26</ERDAT>
      <LIFN2>0000009962</LIFN2>
      <DEFPA />
      <PERNR>00000000</PERNR>
      <PARNR>0000000000</PARNR>
      <KZ>I</KZ>
      </item>
      </T_XWYT3>
      </rfc:Z_I2_SAP2MDM_VM>
    It takes only the first <item> record. How do i take the second record and insert in the oracel DB.
    Seems to me this should be a pretty simple process.
    Regards,
    Ruchi

    Hi ,
    You need to handle  this with the occurence of the Target Structure of the JDBC Adapter..
    Check this help-
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    DB Datatype structure ?
    Hope this helps,
    Regards,
    Moorthy

  • Multiple record insert query

    I realise that this is probably a simple question and I'm just looking for some general pointers. I've already looked through these forums and on the web so don't all jump down my throat at once!
    If I want to insert multiple records into a Mysql database/table, can I do it through Dreamweaver Insert Record function and using a repeat region, or can multiple inserts only be done through programming the PHP/Mysql side of things?
    I need to insert a row for each player in a football match, and need to input starting 11, subs, man of the match etc with checkboxes, so have binded the checkboxes to the table and would like to use a repeat region if this is poss? Or will I have to insert a separate row of checkboxes for each player?
    Any advice much appreciated
    Cheers all
    Bez

    I figured out the method to insert record with auto increment primary key. I listed the code block below:
    char m_SeqNamePositions[32] = "MyPositions";
    DbSequence *m_pSeqPositions;
    m_pDBPositions = new Db(NULL, 0);
              m_pDBPositions->open(NULL, pszFileName, szFileName, DB_BTREE, DB_CREATE, 0);          // 无数据文件
              m_pSeqPositions = new DbSequence(m_pDBPositions, 0);
              Dbt key((void *)m_SeqNamePositions, (u_int32_t)strlen(m_SeqNamePositions));
              m_pSeqPositions->open(NULL, &key, DB_CREATE);
    db_seq_t SeqNum;
         m_pSeqPositions->get(0, 1, &SeqNum, 0);
         Dbt key((void *)&SeqNum, (u_int32_t)sizeof(SeqNum));
         Dbt data(pRecord, sizeof(*pRecord));
         return m_pDBPositions->put(NULL, &key, &data, DB_NOOVERWRITE);
    m_pSeqPositions->close(0);
              m_pDBPositions->close(0);
    delete m_pSeqPositions;
    delete m_pDBPositions;
              m_pDBPositions = NULL;

  • Multiple record insert thru PROCEDURE - Urgent

    All,
    My requirement is, I have to invoke a procedure which accepts two input and 1 out variable. The operation of the procedure is to insert the data to two tables(head_tab and line_tab-accepts multiple record). I used %rowtype for the two inputs i.e procedure proc(head_var head_tab%rowtype, line_var line_tab%rowtype, out_var out number). The incoming doc comes from 3rd party application which sends a header record and multiple line record for the same header.
    I used the transformation activity, to insert line record I used for-each loop for multiple record. But %rowtype being a scalar data type, it doesn't accept array of record to it! I'm stuck here. Can we achieve this scenario with using of procedure? or should I configure DBAdapter to insert the data directly to the table rather the procedure does this? If we can achieve it thru procedure, how can I go about?
    Thanks,
    Sen

    Hi,
    I believe you should change the signature of the procedure.
    I tried below code for my proc to send multiple records without use of for loop.
    Type line_var_rec IS RECORD(
    Var1;
    var2;
    Type line_var_tab IS TABLE OF line_var_rec INDEX BY BINARY INTEGER;
    Type head_var_rec IS RECORD(
    var3;
    var4;
    line_var line_var_tab ;
    Type head_var_tab IS TABLE OF head_var_rec INDEX BY BINARY INTEGER;
    proc(head_var IN head_var_tab, out_var out number);
    With the above code you can insert multiple header records each having multiple line records.
    Pls let me know if u have any questions.

  • Multiple records insertion

    Hi,
    How to insert multiple records at a time using stored procedure.
    Please give me example.
    Regards,
    Kiran

    Kiran,
    If you want to use "variable-number-of-parameters", you need to use array:
    http://stackoverflow.com/questions/980324/oracle-variable-number-of-parameters-to-a-stored-procedure?tab=votes#tab-top
    Best Regards,
    Gokhan Atil
    If this question is answered, please mark appropriate posts as correct/helpful and the thread as closed. Thanks

  • Multiple record insert problem in Oracle Procedure that uses a cursor

    Dear X-pert guies,
    I have a oracle procedure that use a cursor, I repeatedly make query on 1st table using cursor value and insert that queried value(of 1st table) to 2nd table
    y_summary. y_summary has composite  primary key :PK_Y_SUM (BILL_DATE, TRUNK_MGR, IDD_FLAG, PK_FLAG, PREFIX).*
    when i run the procedure explicit2('201001'); the it gives me the error:::: begin explicit2('201001'); end;_
    ORA-00001: unique constraint (PRM.PK_Y_SUM) violated_
    ORA-06512: at "PRM.EXPLICIT2", line 413_
    ORA-06512: at line 1_
    but when i remove the composite primary key from y_summary table then, the procedure runs ok and make so many duplicate entries in y_summary.
    but i want the single record  to be inserted for single time in y_summary ,so You guies are honorly requested to make the required help .
    the structure of y_summary Table and Procdure code is given below.
    Table:
    -- Create table
    create table Y_SUMMARY
    BILL_DATE VARCHAR2(10) not null,
    TRUNK_MGR VARCHAR2(20) not null,
    IDD_FLAG VARCHAR2(10) not null,
    PK_FLAG NUMBER(2) not null,
    OUTCALLS NUMBER(20,2),
    OUTDUR NUMBER(20,2),
    PREFIX VARCHAR2(10) not null
    tablespace TBS_PRM_D01
    pctfree 10
    pctused 40
    initrans 1
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    -- Create/Recreate primary, unique and foreign key constraints
    alter table Y_SUMMARY
    add constraint PK_Y_SUM primary key (BILL_DATE, TRUNK_MGR, IDD_FLAG, PK_FLAG, PREFIX)
    using index
    tablespace TBS_PRM_D01
    pctfree 10
    initrans 2
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    Procedure:
    create or replace procedure explicit2( month_val in varchar2) is
    cursor explicit_cur is select dest_code from y_table where dest_code like '44%' order by dest_code desc;
    dummy varchar2(100);
    lv_length Number(9);
    sqlstr varchar2(2500);
    rec_count1 number;
    rec_count2 number;
    rec_count3 number;
    begin
    open explicit_cur;
    LOOP
    fetch explicit_cur into dummy;
    EXIT WHEN explicit_cur%NOTFOUND;
    rec_count1 :=0;
    rec_count2 :=0;
    rec_count3 :=0;
    lv_length := length(dummy);
    sqlstr := 'select count(*) from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr into rec_count1;
    sqlstr := 'select count(*) from y_table_data1 t where t.fee_dur_1_2 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'',
    ''ITAX1B'',''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr into rec_count2;
    sqlstr := 'select count(*) from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'',
    ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''012'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr into rec_count3;
    if(rec_count1>0) then
    sqlstr := 'insert into y_summary(BILL_DATE ,PREFIX, TRUNK_MGR,OUTCALLS , OUTDUR , IDD_FLAG , PK_FLAG )
    select '|| month_val||' ,substr(t.orig_called_num,1,'||lv_length||'),t.trunkout_operator ,count(*) , round(sum(ceil(t.duration / 15) * 15) / 60, 0),''00'',''1'' from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||''''|| ' group by t.trunkout_operator,substr(t.orig_called_num,1,'||lv_length||')';
    execute immediate sqlstr;
    commit;
    sqlstr :='DELETE from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr;
    commit;
    end if ;
    if(rec_count2>0) then
    sqlstr :='insert into y_summary(BILL_DATE ,PREFIX, TRUNK_MGR,OUTCALLS , OUTDUR , IDD_FLAG , PK_FLAG )
    select '|| month_val||' ,substr(t.orig_called_num,1,'||lv_length||'),t.trunkout_operator ,count(*) , round(sum(ceil(t.duration / 15) * 15) / 60, 0),''00'',''0'' from y_table_data1 t where t.fee_dur_1_2 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' group by t.trunkout_operator,substr(t.orig_called_num,1,'||lv_length||')';
    execute immediate sqlstr;
    commit;
    sqlstr :='DELETE from y_table_data1 t where t.fee_dur_1_2 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr;
    commit;
    end if;
    if(rec_count3>0) then
    sqlstr :='insert into y_summary(BILL_DATE ,PREFIX, TRUNK_MGR,OUTCALLS , OUTDUR , IDD_FLAG , PK_FLAG )
    select '|| month_val||',substr(t.orig_called_num,1,'||lv_length||'),t.trunkout_operator ,count(*) , round(sum(ceil(t.duration / 15) * 15) / 60, 0),''012'',''0'' from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''012'' group by t.trunkout_operator,substr(t.orig_called_num,1,'||lv_length||')';
    execute immediate sqlstr;
    commit;
    sqlstr :='DELETE from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''012'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr;
    commit;
    end if;
    end loop;
    close explicit_cur;
    end explicit2;
    Edited by: user10951541 on 25.4.2010 12.08

    Dear concern
    Really sorry not to make format listing because i am amature to this blog.
    my anwser to your way .
    1. I have Tested my SQL statements manually in SQL*Plus. this runs ok
    2. "Cursor loops, such as the one you have coded here, have been obsolete in Oracle since version 8i 12+ years ago.
    Look up BULK COLLECT and FORALL in the docs and use them instead."
    I am trying to make use of the BULK COLLECT and FORALL statement in proper location.
    3. "Your procedure never performs a commit so no work actually takes place" i need to get the anwser why........................?
    4. "On what basis was the decision made to use the default PCTFREE and PCTUSED values of 10 and 40?"
    is there any problem if default is used..? if any suggestion........pls
    5." You did not format your listing using the CODE tags as explained in the FAQ making your listing unreadable ... so I've not read it.
    Please read the FAQ and use the proper way to post code so we can understand it. Then perhaps we can help you further. " really sorry not to make understandable to you..? but i will try from next post..
    I really will try to be synced..
    My aim is to make query to Table A using the cursor value like( '4422','442','4411','441','44') and get some data in accordance of these values.Then i put the data into another Table B. same time i need to delete the record from Table A containing the prefix value in accordance for example- i compute value for '4422' from Table A and put the computed value to Table B .Then i delete the record from Table A where prefix is '4422' .so that computed value for the next prefix '442' should contain the computed value for 442[0-1] and 442[3-9] .Same way it will be happened for ('4411','441','44'....bla...bla).
    Thanks in advance..

  • Multiple Record Insert

    Hello All,
    Through JSP I am uploading a tab delimited text file. Each line is a record. I want to insert this record into the DB using ejb. The problem is the record might already exist and in that case I have to update the record.
    Basically for each line I have to call findbyprimarykey and if no exception then insert else update. I am using BMP. It takes long time to load 1000 records since each method involves a connection, do the operation and then close the connection. So for 1000 recs it repeats the same operation 1000 times.
    What is the best way to do this load?
    Thanks in advance

    If you make sure all updates/inserts run in the same transaction things will go faster. You can make a batchUpdate(String allData) method in your EJB, I suppose? I'm not that familiar with BMP, I usually go with CMP.
    You should also use a connection pool. Your appserver has one, many jdbc-drivers implement pools, and you can even write your own (as a funny exercise, it's not to difficult, and not to useful :-) If you can make everything run in one transaction, also only one connection will be used, I think transactons cannot span connections. (Correct me if I'm wrong here ... :-)
    As someone else suggested, using straight jdbc is also an option. But if your app at the time is BMP-only, you might have reasons to keep it that way.
    Jon Martin Solaas
    [email protected]
    http://solaas.minidns.net

  • Problem for Struts action to insert multiple records

    I am writting a code for Struts action which inserting a single record to table A and multiple records to table B .The architecture that I applied is Struts+Spring+iBatis.The multiple records are come from a 10-rows table in the design.The name of each column element is same.The field name other than these are just single-row field.
    <tr>
    <td><input name="date" type="text" size="12" /></td>
    <td><input name="billno" type="text" size="8" /></td>
    <td><input name="desc" type="text" size="11" /></td>
    <td><input name="purpose" type="text" size="20" /></td>
    <td><input name="proName" type="text" size="6" /></td>
    <td><input name="trainingCost" type="text" size="5" /></td>
    <td><input name="travelCost" type="text" size="7" /></td>
    <td><input name="entCost"  type="text" size="5" /></td>
    <td><input name="miscCost" type="text" size="5" /></td>
    </tr> I am using three DTO objects to hold the data.claimArray is the ClaimDTO array that hold the multiple record insert to table B.claimdto is the object that hold the single field record to table A.claim_dtldto is the object that hold the single field record to table B.
    PK of table A and table B are claimNo and claimDtlNo respectively.claimNo is also FK of table B. HTMLUtil is just an API that I used it for type conversion.There will have two insert statements in iBatis xml, insertClaim & insertClaimDtl to insert data into table A and table B respectively.I not sure what went wrong in the code,the data is not inserted into db.Thank advanced for you guys help..
    This is the codes in Action file:
    public class InsertClaimAction extends SpringAction {
       public ActionForward execute(ActionMapping mapping,
                                     ActionForm form,
                                     HttpServletRequest request,
                                     HttpServletResponse response) throws Exception {
        // string arrays that store multiple values
        String [] date = new String[10];
        String [] billno = new String[10];
        String [] description = new String[10];
        String [] purpose = new String[10];
        String [] proName = new String[10];
        String [] trainingCost = new String[10];
        String [] travelCost = new String[10];
        String [] entCost = new String[10];
        String [] miscCost = new String[10];
        String staffName = request.getParameter("name");
        String claimMy = request.getParameter("monthyear");
        String department = request.getParameter("department");
        String designation = request.getParameter("designation");
        Double excrate =  HTMLUtil.str2double(request.getParameter("excrate"),0.0);
        Double grandTotal = HTMLUtil.str2double(request.getParameter("grandTotal"),0.0);
        Double totalRM = HTMLUtil.str2double(request.getParameter("totalRM"),0.0);
        Double totalFC =    HTMLUtil.str2double(request.getParameter("totalFC"),0.0);
        String fcName = request.getParameter("fcAbbr");
        if(request.getParameter("date") != null)
            date = request.getParameterValues("date");
        if(request.getParameter("billno") != null)
            billno = request.getParameterValues("billno");
        if(request.getParameter("description") != null)
            description = request.getParameterValues("description");
        if(request.getParameter("purpose") != null)
            purpose = request.getParameterValues("purpose");
        if(request.getParameter("proName") != null)
            proName = request.getParameterValues("proName");
        if(request.getParameter("trainingCost") != null)
            trainingCost = request.getParameterValues("trainingCost");
        if(request.getParameter("travelCost") != null)
            travelCost = request.getParameterValues("travelCost");
        if(request.getParameter("entCost") != null)
            entCost = request.getParameterValues("entCost");
        if(request.getParameter("miscCost") != null)
            miscCost = request.getParameterValues("miscCost");
          //initialize dto
        ClaimDTO claimdto = new ClaimDTO();
        ClaimDTO claim_dtldto = new ClaimDTO();
        ClaimDTO[] claimArray = new ClaimDTO[10];
        claimdto.setClaimNo(claimNo);
        claimdto.setStaffName(staffName);
        claimdto.setClaimMy(claimMy);
        claimdto.setDepartment(department);
        claimdto.setDesignation(designation);
        claimdto.setExcrate(excrate);
        claimdto.setGrandTotal(grandTotal);
        claim_dtldto.setClaimDtlNo(claimDtlNo);
        claim_dtldto.setClaimNo(claimNo);
        claim_dtldto.setTotalRM(totalRM);
        claim_dtldto.setTotalFC(totalFC);
        claim_dtldto.setFcName(fcName);
        for(int i = 0;i < claimArray.length;i++) {
            if(claimArray[i] != null) {
                claimArray.setDate(date[i]);
    claimArray[i].setBillno(billno[i]);
    claimArray[i].setDescription(description[i]);
    claimArray[i].setPurpose(purpose[i]);
    claimArray[i].setProName(proName[i]);
    claimArray[i].setTrainingCost(Double.parseDouble(trainingCost[i]));
    claimArray[i].setTravelCost(Double.parseDouble(travelCost[i]));
    claimArray[i].setEntCost(Double.parseDouble(entCost[i]));
    claimArray[i].setMiscCost(Double.parseDouble(miscCost[i]));
    //service
    ClaimService springservice = (ClaimService)getBean("ClaimService");
    springservice.insertClaim(claimdto);
    springservice.insertClaimDtl(claim_dtldto,claimArray);
    return mapping.findForward("success");

    Two things; you need to pass #number# as a form field and you
    need to pull the correct record out.
    Use this:
    <cfloop list="#form.fieldnames#" index="fieldName">
    <CFSET record = Evaluate("form.record_#number#")>
    </cfloop>
    Here's some example code:

  • Multiple records as a single transaction in JDBC Receiver Adapter

    Hi,
    I am sending multiple records in a single message to a JDBC receiver adapter to get updated to the database. How to make all the insert a single transaction. Like all the records has to be inserted else all has to be rolled back.
    For eg for table Employee two fields EMPNO and EMPNAME
    EMPNO  EMPNAME
    1            Jay
    2            Christie
    These two records are in the same message and has to be updated
    if one fails the other has to be rolled back.
    How can i achieve it using a JDBC Receiver Adapter.
    Thanks
    Sebin

    Hi Rolf Micus,
    My xml structure to insert 2 tables are as follow:-
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_PODB xmlns:ns0="http://abeam.com/xi/fer_filejdbc_scenarios1">
    ..   <STATEMENT_HEADER>
    ....      <ROW action="INSERT">
    ......         <TABLE>ZPO_HEADER</TABLE>
    ......        <access>
    ........            <PONUMBER>001</PONUMBER>
    ........            <PODATE>20070801</PODATE>
    ........            <POAMOUNT>200.99</POAMOUNT>
    ....         </access>
    ....      </ROW>
    ..   </STATEMENT_HEADER>
    ..   <STATEMENT_DETAIL>
    ....      <ROW action="INSERT">
    ......         <TABLE>ZPODETAIL</TABLE>
    ......         <access>
    ........            <PONUMBER>001</PONUMBER>
    ........            <PONO>1</PONO>
    ........            <POITEMCODE>A12345</POITEMCODE>
    ........            <POITEMDESC>Testing A</POITEMDESC>
    ........            <POITEMAMOUNT>2990.00</POITEMAMOUNT>
    ........            <POITEMQTY>55</POITEMQTY>
    ......         </access>
    ....      </ROW>
    ..   </STATEMENT_DETAIL>
    </ns0:MT_PODB>
    Fro the structure that you have declared..there is only contained 1 statement, try to admend your MT to have 2 statements.
    If you wish to insert multiple records, just create a loop/multiple of access tag inside STATEMENT tag. For example, multiple records insert into Header should have multiple access tag in Header STATEMENT. Same goes for muliple records insert into Details STATEMENT should have multiple access tag in Details STATEMENT.
    With this structure, whenever any records insert/update/delete failed...it will rollback all the transactions together, ie. Header and Details.
    PS: For different table, please create different STATEMENT.
    Hope it helps.
    Message was edited by: Pua Ming Fei

  • Multiple Records in XI

    Hi Folks ,
    Can you guide me in
    1. Handling multiple records from source and posting one at a time into JDBC .
    2. Fetching single records from JDBC and sending as a batch.
    Regards,

    Hi santosh
    refer the below links
    http://help.sap.com/saphelp_nw04/helpdata/en/42/ed364cf8593eebe10000000a1553f7/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    DB Datatype structure ?
    Multiple Records insertion
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    Sending Multiple records   
    http://help.sap.com/saphelp_nw04/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ae/fd773f12f14a18e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/content.htm
    just have a look may be  help you

  • Inserting multiple records into a database from a table

    I have a dynamic table with rows upto 10. i am trying to insert all the records in these rows into a database ( msaccess)
    table name: Table1 ( in my form )
    Database table : movies_comments ( as posted in stefan's forums ).
    table columns: username, movieid, comments
    i am using the following code.
    Database.ExecSQL() function is as posted in stefcamerons forums.
    var tlength = xfa.resolveNode("form1.#subform[0].Table1.Row1[*]").length;
    xfa.host.messageBox("tlength is :" +tlength);
    for ( var i = 1; i <= tlength; i++)
    var username = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].user_name").rawValue;
    var movieID = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].movie_id").rawValue;
    var commentS = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].comment_").rawValue;
    Database.ExecSQL("INSERT INTO movie_comments (username, movieId, comment) VALUES ('username','movieID', 'commentS');");
    i am trying to insert multiple records using the code above. But i am getting error
    GeneralError: Operation failed.
    XFAObject.resolveNode:1:XFA:form1[0]:#subform[0]:Button1[0]:click
    SOM expression returned list when single result was expected
    suggest me an alternate way to insert multiple records from a table into a database.
    thank Q

    figured it out. I changed the ...OR (alternative names = colname) in the recordset to ...OR (alternative names LIKE %colname%). Works like a charm now- the result of a good night's sleep.

  • Insert multiple records into a table(Oracle 9i) from a single PHP statement

    How can I insert multiple records into a table(Oracle 9i) from a single PHP statement?
    From what all I've found, the statement below would work if I were using MySQL:
         insert into scen
         (indx,share,expire,pitch,curve,surface,call)
         values
         (81202, 28, 171, .27, 0, 0, 'C' ),
         (81204, 28, 501, .25, 0, 0, 'C' ),
         (81203, 17, 35, .222, 0, 0, 'C' ),
         (81202, 28, 171, .27, 2, 0, 'C' ),
         (81204, 28, 501, .20, 0, 1, 'C' ),
         (81203, 28, 135, .22, 1, 0, 'C' )
    The amount of records varies into the multiple-dozens. My aim is to utilize the power of Oracle while avoiding the i/o of dozens of single-record inserts.
    Thank you,
    Will

    You could look at the INSERT ALL statement found in the documentation here:
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_913a.htm#2133161
    My personal opinion is that you probably won't see any benefit because under the hood I think Oracle will still be doing single row inserts. I could be wrong though.
    The only way to confirm was if you did a test of multiple inserts vs an INSERT ALL, that is if the INSERT ALL met your requirements.
    HTH.

  • Mapping is inserting multiple records from a single source to Dimension.

    Hi All,
    I am very new to OWB. Please help me out. I've created Dimension with the help of the wizard and then a mapping which consist of single source and single dimension. The mapping is populating nearly 500 times of the actual records. Following are some details to give you a better understanding of mapping: I created a dimension with four levels and two hierarchy. Levels are L1, L2, L3 and L4 and hierarchies are H1-> L1, L2 and L4
    and H2-> L3 and L4. L4 is lowest level of hierarchy. L1 and L3 are parent levels in the respective hierarchies. I assigned an attribute of each level as Business identifier that means business identifier attribute is different in each level. In mapping I mapped the parent natural key(Key for parent Level in a hierarchy) as the value which has been mapped for parent level. The result is coming 500 times of the record that exist in source table. I've tried even single common business identifier for each level but again the result is 5 times of the records. Please let me know the solution.
    Thanks is advance.
    Amit

    Hi ,
    You may not be having multiple records in your dimension.
    To understand better the records insertion, try a snow flake version of the dimension and see how the records are inserted as per the levels in the respective tables.
    Thanks

  • Insert Multiple records using Database adapter with Stored procedure func

    Hi All,
    I want to insert multiple records on a database using a stored procedure. I wanted to insert those records using a Database Adapter and the Database adapter should be invoked by a Mediator.
    Can somebody suggest me with ideas whether it can be acheived with OOB capabtilities in SOA suite or not?
    Thanks for your help in advance.
    Thanks,
    Shiv

    The use case you want to achieve is feature supported by the DBAdapter and it is possible to invoke the same from mediator.
    Please have a look at the oracle documentation and you should be able to get the necessary information.
    The below links should help you as well:
    http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10231/adptr_db.htm
    http://blogs.oracle.com/ajaysharma/2011/03/using_file_adapter_database_adapter_and_mediator_component_in_soa_11g.html
    There are some video tutorials as well :)
    http://www.youtube.com/watch?v=dFldS-fDx70 This should also help
    Thanks,
    Patrick

Maybe you are looking for

  • AQ tables have DATE columns in 9i and TIMESTAMP in 10g

    Hi, I created a queue table on 9i and 10g database's using eg: dbms_aqadm.create_queue_table(queue_table => 'TEST', queue_payload_type => 'RAW', multiple_consumers => TRUE, compatible => '8.1.3'); But in 9i ENQ_TIME DATE and 10g ENQ_TIME TIMESTAMP(6)

  • And yet another publishing error

    I'm trying to publish my sites to a folder so I can upload them to my domain server. iWeb is not able to publish to the local folder on my desktop without getting a publishing error. I'm seeing other issues similar to mine on the forums. Wondering if

  • How to getJ2ME to work with Oracle Lite

    Has anyone tried using J2ME with Oracle Lite for PDA devices. We are trying to build a cross platform application. The handheld app will run on J2ME container (In PDA) . We want to use Oracle Lite , but cannot get J2ME to talk with Oracle Lite. Can s

  • Told not to Shut off background apps ios 8

    During a recent visit to the Apple Store for a warranty, I was told by the employee that I should not be shutting down manually any background apps running. The proper way was to restart my phone periodically and the operating system would take care

  • Recovery of deleted archived emails

    I inadvertantly deleted my archived emails.....is there a way to recover them?