How to insert multiple records in DB table

HI Experts,
Jdev 11.1.2.3
I have requirement where my form belongs to two different tables (TableA and TableB).
In this form am using ADF shuttle component. The number of values i select in shuttle component same number of records to be inserted in TableB with each value.
on commit TableA and TableB both should be commited.
Thanks,
Nitesh

Hi,
You can use a managed bean as the target of the value property of the shuttle component. Then in a value change listener you read the selected values and manually update the model. For this you could e.g. expose two view objects (one for each table) as an iterator to the PageDef file, access it from Java and then call dcIteratorBindingInstance.getRowSet().createRow() to create and populate new rows
The above is a bit rough in the outline, but so is the question
Frank

Similar Messages

  • How to insert multiple records into a table?

    hi all 
    i have a table that name is : TiketsItem
    now i  want to 100 records insert my table
    for example : TicketsHeaderRef=52000
    Active=False
    TicketsItemId=45000 to 45100
    how to insert TicketsItemId  45000 to 45100 in my table
    thanks all
    Name of Allah, Most Gracious, Most Merciful and He created the human

    So, you just want to insert the serialized data into the table, without useDate or WKRef? I'm assuming these values will be updated later?
    Try something like this:
    DECLARE @TicketsHeader TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsHeader (TicketsItemID, ticketsHeaderRef, active)
    VALUES (52000, @startInt, 0)
    SET @startInt = @startInt + 1
    END
    SELECT *
    FROM @TicketsHeader
    thanks 
    i edited your codes:
    DECLARE @TicketsItem TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsItem (TicketsItemID, ticketsHeaderRef, active)
    VALUES (@startInt,52000 , 0)
    SET @startInt = @startInt + 1
    END
    when i execute:
    SELECT *  FROM TiketsItem
    i do not see any records inserted in TiketsItem
    how to solve it?
    Name of Allah, Most Gracious, Most Merciful and He created the human

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

  • Inserting Multiple Records into two table

    I want to insert records from a ADF swing form into two tables. In the first table the primary key is generated by a trigger and then I need to retrieve the primary id generated and then insert multiple records in another table using the primarykey obtained from the first table as foreign key.
    How to do this ?

    User,
    If you're using ADF Business components, have a read on the DBSequence data type. If you have two VO's linked by a view link, and the FK is a DBSequence type, all this happens for you out-of-the-box.
    Hope this helps,
    john

  • How to insert multiple records in a single query

    Dear all,
    Can you please tell
    how to insert multiple records in a single query ??

    INSERT INTO table_name (column_1, column_2) VALUES ('value_A', 'value_B')OR
    INSERT INTO table_name
    (column_1, column_2)
    SELECT 'value_A', 'value_B' FROM DUAL
    UNION ALL
    SELECT 'value_C', 'value_D' FROM DUAL
    ;Edited by: Benton on Nov 9, 2010 1:59 PM

  • How to insert a record in ROOSPRMSC table? (accidentally deleted)

    Calling an InfoPackage in BW causes short dump, while fixing the short dump issue, accidentally
    deleted the "ROOSPRMSC" table entries.
    Could you tell me how to insert a record in "ROOSPRMSC" table???

    Hi Senthil,
    Regards,
    Phani Raj Kallur
    Message was edited by: Phani Raj Kallur

  • How to insert multiple records?

    I have dynamically checkboxes, which get the data from database. I have used a FOR loop to store each value of the checkbox to session variables, i.e.
    session.setAttribute("Slangs"+a,request.getParameter("langsID"+a)); (p/s: a is a counter, I also set a hidden variable to store the number of record in DB)
    Now, I wanna insert these records to the table called CusLangs which has CusID(PK) and Langs(PK). I wanna construct a insert.jsp, so that those checkboxes that I selected can be written into table CusLangs.
    Anyone know how to do that?
    Thanks.
    From
    jeff

    You have a checkboxes with the same name in your html/jsp.When you post to a servlet/jsp, use request.getParameterValues("checkboxname ) to get String [], ie.
    <html>
    <input type="checkbox" name="sampleCheck" value="1">
    <input type="checkbox" name="sampleCheck" value="2">
    </html>
    Servlet/ JSP
    String check[] = request.getParameterValues("sampleCheck");
    query = "Insert into CusLangs (CusID) values (?') ";
    stmt = connection.prepareStatement(query);
    for(int i=0, i < check.length, i++) {
    stmt.setString(1, check[0]);
    int x = stmt.executeUpdate();
    Hope this will help.

  • How to insert some records in one table and some records in another table

    Interview question
    how insert records in two tables by using trigger
    CREATE or REPLACE TRIGGER Emp_Ins_Upd_Del_Trig
    BEFORE delete or insert or update on EMP
    FOR EACH ROW
    BEGIN
    if UPDATING then
    UPDATE emp2
    SET
    empno = :new.empno,
    ename = :new.ename
    --, job = :new.job
    --, mgr = :new.mgr
    --, hiredate = :new.hiredate
    , sal = :new.sal
    --, comm = :new.comm
    --, deptno = :new.deptno;
    sdate = :new.sdate,
    edate = :new.edate
    end if;
    if INSERTING then
    INSERT INTO emp2
    VALUES
    ( :new.empno
    , :new.ename
    --, :new.job
    --, :new.mgr
    --, :new.hiredate
    , :new.sal
    --, :new.comm
    --, :new.deptno
    new.sdate,
    new.edate);
    end if;
    if DELETING then
    DELETE FROM emp2
    WHERE empno = emp2.empno;
    end if;
    END;
    it is working fine but he wants to insert some specific litimit on one table and some specified limit of records in one ..
    In this senerio can i insert records by use count of records...
    please help me..

    Can you be more specific on the "Limit"
    Conditional insert can be used in this case.

  • How to insert new record into altered table

    I am using JDBC with MySQL. I altered existing table and want to insert new record using java class. But it is not possible.How to do?

    How is it "not possible"?
    Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
    Where's the problem?

  • How to insert new record into oracle table from GridView in VS2005.

    I need to insert records into Oracle10g table from VS2005 GridView using the Insert Method in Business Logic Class. The Update and Delete Methods are working fine. What's the best way out?

    How is it "not possible"?
    Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
    Where's the problem?

  • How to insert bulk records in a table

    Hi to all,
    I have one view in which more the 3 lacks records are there and i have to insert that data in a table and used the code in which it taking a lot of time.
    I checked one case in which 2000 records are there it taking 5 min apprx. to insert it
    Is there any solution to insert the bulk data in a short period of time.
    Below code i used to insert
    procedure ticket_previous_detail (p_err_msg out varchar2) is
    type t_type is table of ticket_previous_details%rowtype;
    v_tab t_type;
    PRAGMA AUTONOMOUS_TRANSACTION;
    begin
    SELECT * bulk collect into v_tab
    from ticket_previous_details; (It contains 3 lacks record)
    FORALL x in v_tab.First..v_tab.Last
    INSERT INTO xx_prev_tckt ( Insert in this)
    VALUES v_tab(x) ;
    p_err_msg := 'Successfully Inserted';
    commit;
    exception
    when others then
    p_err_msg := sqlerrm;
    rollback;
    end ticket_previous_detail;
    Thanks in advance!
    Edited by: Oracle Consultant on Apr 14, 2011 3:42 PM
    Edited by: Oracle Consultant on Apr 14, 2011 3:42 PM

    Oracle Consultant wrote:
    Hi to all,
    I have one view in which more the 3 lacks records are there and i have to insert that data in a table and used the code in which it taking a lot of time.
    I checked one case in which 2000 records are there it taking 5 min apprx. to insert it
    Is there any solution to insert the bulk data in a short period of time.
    Below code i used to insert
    procedure ticket_previous_detail (p_err_msg out varchar2) is
    type t_type is table of ticket_previous_details%rowtype;
    v_tab t_type;
    PRAGMA AUTONOMOUS_TRANSACTION;
    begin
    SELECT * bulk collect into v_tab
    from ticket_previous_details; (It contains 3 lacks record)
    FORALL x in v_tab.First..v_tab.Last
    INSERT INTO xx_prev_tckt ( Insert in this)
    VALUES v_tab(x) ;
    p_err_msg := 'Successfully Inserted';
    commit;
    exception
    when others then
    p_err_msg := sqlerrm;
    rollback;
    end ticket_previous_detail;
    Thanks in advance!
    Edited by: Oracle Consultant on Apr 14, 2011 3:42 PM
    Edited by: Oracle Consultant on Apr 14, 2011 3:42 PMAssuming that your target table(xx_prev_tckt ) will have same strcture as of source table (ticket_previous_details)
    CREATE TABLE xx_prev_tckt  AS (SELECT * FROM ticket_previous_details);Later create index on the above table and start working...
    Hope this helps.
    Regards,
    Achyut

  • How to insert a record in another table

    Hi,
    Can you please help with this urgent problem.
    Suppose my data model is
    SELECT id
    FROM emp
    WHERE salary < 10000
    I would like to create a record in another table for EACH emp.id returned, I wonder which trigger is appropriate to place the INSERT statement?
    And I DON'T want to do like this
    SELECT id, Create_Record(:id)where Create_Record is a function.
    Hope the information here is sufficient.
    Thanks

    Hien
    I had a similar requirement to you and put the code on a push button. In my case the reports are being run interactively to the screen and then printed, and I have no way to know whether the report had actually been printed, so we rely on the user pressing the button. Of course there is a danger that the user forgets to press the button, but in our situation that would not be disasterous. Whatever method is used, I don't think there is any way to be sure that it has actually come out of the printer.

  • Inserting Multiple Records in Transparent Table

    Hi Friends,
    I am New to ABAP and Previously i was in Web Dynpro Java....
    I am doing an scenario Travel Request.
    The Problem i am facing i this scenario is inserting the data in the table. I have to maintain a custom table in which Travel request No (Primary Key), Employee No (Primary Key) and Transport Details.....etc.are maitained...
    Employee Number  -
    Travel Request No--Place From-Place To       
    70043 -
    817--Chicago--
    Miami
    70043 -
    817--Miami--
    Chicago
    I have to maintain table like this
    Whenever i inseted the data into the Tranparent Table its showing dump and sy-subrc count is 4
    Plz provide suggestion to achieve this........Thanks in Advance
    Regards
    Chandran S

    In ur case u r trying to enter duplicate values that's why u r getting error.
    In ur custom table, Employee Number  and Travel Request No are 2 primary keys. That means for each record content of these fields should be unique but in ur case they are same. If u really need to maintain data in this way then u have to make another field as key field so that it can uniquely identify a record.
    Employee Number Travel Request No Place From Place To
    70043 817 Chicago Miami
    70043 817 Miami Chicago
    Regards,
    Joy.

  • How to update multiple records in a table created in view (web dynpro)

    Here is my coding......
    *coding to get the district value
    DATA lo_nd_district TYPE REF TO if_wd_context_node.
        DATA lo_el_district TYPE REF TO if_wd_context_element.
        DATA ls_district TYPE wd_this->element_district.
        DATA lv_district_txt LIKE ls_district-district_txt.
      navigate from <CONTEXT> to <DISTRICT> via lead selection
        lo_nd_district = wd_context->get_child_node( name = wd_this->wdctx_district ).
      get element via lead selection
        lo_el_district = lo_nd_district->get_element(  ).
      get single attribute
        lo_el_district->get_attribute(
          EXPORTING
            name =  `DISTRICT_TXT`
          IMPORTING
            value = lv_district_txt ).
    *coding to diplay records when clicking a button(Submit)
    DATA lo_nd_table TYPE REF TO if_wd_context_node.
    DATA lo_el_table TYPE REF TO if_wd_context_element.
    DATA ls_table TYPE wd_this->element_table.
      DATA lv_district LIKE ls_table-district.
    navigate from <CONTEXT> to <TABLE> via lead selection
      lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
    get element via lead selection
      lo_el_table = lo_nd_table->get_element(  ).
    get single attribute
      lo_el_table->set_attribute(
        EXPORTING
          name =  `DISTRICT`
       " IMPORTING
          value = lv_district_txt ).
    The above coding updates only one record to that
    table created in view.
    If i enter 2nd district value means then the first record
    in the table is overwritten.
    So my need is the record should not be overwritten.
    it(2nd record ) should be displayed after the 1st record.
    Any one can help me and send the coding plz....

    instead of using set attribute you should use bind table method to display/update the records in table view.
    step1 ) collect all the data in a local table
    step2 ) and the bind that lacal table with your node
    search1 = wd_context->get_child_node( name = `TABLE1` ).
    search1->bind_table( lt_detail)
    here lt_detail is your local table and TABLE1 is node which is bound with table ui element.

  • Inserting multiple records in a table through detail block

    hi,
    i am new to oracle forms. i want to enter more than one records in a table through a master detail forms.
    the records will be entered by user in the detail section. can any ody help me?

    Hi Lance,
    Try creating records in detail block in the when new block instance trigger of
    detail block. Set the validation unit property of the form to FORM before trying this.
    Hope this might be helpful to you.
    V.Senthil Kumar

Maybe you are looking for

  • Not getting all records in pagination

    I am also have a problem getting all records in the report as the post on Apr. 21,2004. My reports pagination stops at 500. When I set the 'max row count' to 100000. The pagination at the bottom of my page disapears. When I leave 'max row count' empt

  • How do I remove Safari from just one account on a multi-account computer?

    I'm not new to macs, but I am new to multiple accounts on one computer, so forgive me if this is a real obvious question: I have two accounts, A & B. I want to have Safari on account A, but not on account B. However, when I trash Safari on account B,

  • Switching pages from flash-gui

    I tried to switch to a page using a flash-button inside an rma which functions as a gui. To do so I use an external interface call: var jsCaller:Object = ExternalInterface.call("eval","this.pageNum = 1;"); I use eval frequently to call various method

  • Although I have the most current version, I keep getting a non-functional popup recommending a software update

    the popup window is titled "Software Update" and the text says "it is strongly recommended that you apply this update for Firefox as soon as possible." There is a hotlink "View more information about this update", which doesn't appear to be active, a

  • WORD COMPATIBILITY ISSUE

    I just recently switched to a Macbook Pro and used the Migration Assistant to transfer all my files from my PC to my new Mac. I have installed Microsoft Office on my new Macbook as well. I opened a file today, tried to edit it, and then save my work