Update two table in receiver jdbc

Dear all;
i have one issue sync update as below;
stmt1.
one table(TB10) and has key is  MATNR  and  value AAA,   i am trying to update  key value AAA.
then stmt1_response return to update_count 1.
stmt2.
sencond table(TB20) and has key is  MATNR  and  value BBB,   i am trying to update  key value BBB that there is no BBB in table(TB20).
then stmt2_response return to update_count 0.
when stmt2_response to update_count 0,  I  want stmt1 to be roll back .  is it possible ?    i realized that  stmt1 is updated although stmt2 is not updated,

Hi,
i mad a jdbc lookup,  how do i occur mapping error with result of query execution?
the following #1 statement  does not work.
please help ,  how to throw exception on mapping process?
stmt2.
for( Iterator rows = resultSet.getRows(); rows.hasNext(); ) {
            Map rowMap = (Map)rows.next();
            result = (String)rowMap.get("MATNR");
#1    if (!"".equals(result) && result  != null) {
            } else {
                   throw new RuntimeException("no data : " );

Similar Messages

  • Updating two tables through JDBC

    <b>Hai,
    Can anybody please answer the following question?
    How can I update two table in Receiver by using JDBC Adapter at receiver side from single source structure.
    Thanks in advance.</b>

    Hi ,
    Create following structure for inbound data type to insert data in DB using JDBC receiver adapter here dbTableName1 is for first table and dbTableName2 for second table .
    <StatementName2>
    <dbTableName1 action="UPDATE_INSERT">
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName1> 
    <dbTableName2 action="UPDATE_INSERT">
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName2> 
      </StatementName2>
    Thanks ,
    Suvarna
    pls award pts if it helps

  • How to update two tables in a single call using JDBC Sender adapter

    Hello All,
    The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
    We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
    Update Statemtent: We can only update one table using this statement.
    Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Let me know.
    Regards,
    Sreenivas.

    Hi Sreenivas,
    > Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Yes its possible through join statement
    Check this links
    Update in JDBC Sender adapter for more than one table
    data from 2 tables for jdbc sender adapter
    Regards
    Ramesh

  • How to use one form to update two tables

    How can I do that? HTMLDB wizard or form on table doesn't give me an option to use more than one table in a form or I don't know about it. I created new process which redirects the form to another page after submitting the form. On the second page I created new process which uses the same variables from the previous form page. This process runs on page load before header but it is just not working right.
    So, what is the proper way to update two tables with the same form fields?

    Hello Vikas,
    "The Automatic Row Fetch and Automatic DML processes are a pair, you can't have one without the other."
    Are you sure about that? I have a page, which populate some of the items from TableA, using manual select statement, and after the user input, save some of it in TableB, using Automatic DML. No ARF in this process and it seems to work just fine. Come to think of it, what about a simple form, populated entirely by the user input, and then being saved to the db, using Automatic DML? No ARF here also.
    For the problem in hand, if you can't have more then one Automatic DML per page, I think that the simplest solution will be to define a pl/sql process, with two INSERT statement to the two different tables.
    Regards,
    Arie.

  • Updating two tables at the same time

    Please,
    Does someone have an idea on how to update two tables at the same times?
    Thanks a lot in advance

    I was thinking about a single session and single update command.
    That's why I thougth someone else could have a clue.
    Thank you

  • Can you really update two tables in one SQL statement

    Ok a post in the forum has got me awefully curious:
    Can you update two tables in one update statement i.e something like this
    update table a , b
    set b.<column> = something
    a.<column> = something
    Something to this effect.
    If you are curious to know what post I am talking about it is called "updating a single row"

    No. You can only update one table in one SQL statement.

  • How to update two tables with trigger

    Hi:
    how to update two tables with trigger ?
    I have two tables :
    (1)ASIA
    MI number;
    (2)ASIA_P
    ID number;
    When I insert a new value into the asia.MI ,I also can
    insert the same value into the asia_p.id field.
    I have write a trigger as follows but it does't work.
    create or replace trigger MI_TRG
    before insert on asia
    for each row
    declare
    seq number;
    begin
    select MI_SEQ.Nextval into seq from dual;
    :new.MI:=seq;
    insert into ASIA_PRO(MI_ID)
    values
    (seq);
    end MI_TRG;
    How to realize it ?
    thanks
    zzm

    Why do you say it does not work?

  • Using a single Form to Update two tables.

    I would like some assistance please?
    I have an "<strong>Event</strong>" ,"<strong>Item</strong>" and "<strong>Item allocation</strong>" tables . The "Item_allocation" table serves as a composite table joining the "Item " and "Event" table. The relationships are as follows (*1*)Event :(*M*)Item and vice versa. * hence the reason for the third table.
    Attributes are as follows.
    <u>Event</u>
    Eventid(pk)
    Eventname
    Eventdate
    <u>Item</u>
    Itemid(pk)
    Itemname
    Itemcost
    Itemallocation_
    Item_allocationid(pk)
    Eventid(fk)
    Itemid(fk)
    <strong><u>What I'm essentially trying to achieve here is , allow the user to book and event and as part of that process be able to select multiple items.. I need the both "Event " and "Item_allocation" tables to be updated.</u></strong>
    Thank you in advance.

    Hi,
    Try creating the form based on a view and use an INSTEAD OF trigger to create the records in the two tables. Here's an example of this: Report & form on Multiple table
    Andy

  • How To Update two tables at once

    Hi,
    I have to join two tables for an update. Is it possible to update both tables in one update statement? Thank you.
    UPDATE table_a a, table_b b
    SET
    a.name = 'Tom',
    b.city = 'New York'
    WHERE
    a.id = b.id

    Is it possible to update both tables in one update statement? That's not possible.

  • Updating two table from a single query

    I have two table such as
    user_log(user_id , password)
    and
    user_info(user_id , name , age , address , sex , email , contact)
    If I want to add data from a single form in php then what is the query?

    Hi,
    welcome to the forum..! plesae always post table data and expected result to help forum members help you better.
    From what I understand, all you need is a join on userid (assuming userid is unique/primary key )
    select ul.userid,
             ul.password,
            ui.name,
            ui.age
      from user_log ul,
              user_info ui
      where ul.user_id = ui.user_id
        ---- and any otehr condition for the user that you need.(where clause)In PHP......(based on this link.. http://wiki.oracle.com/page/PHP+Oracle+FAQ
    haven't tested the code.. )
    <?php
    $conn = oci_connect("scott", "tiger", "localhost/XE");
    if (!$conn) {
    $m = oci_error();
    echo $m["message"];
    exit;
    $stid = oci_parse($conn, "select ul.userid,
             ul.password,
            ui.name,
            ui.age
      from user_log ul,
              user_info ui
      where ul.user_id = ui.user_id");
    oci_execute($stid);
    // Query the table
    echo "<table border='1'>";
    while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
    echo "<tr>";
    foreach ($row as $item) {
    echo "<td>".($item!==null?htmlentities($item):" ")."</td>";
    echo "</tr>".PHP_EOL;
    echo "</table>";
    oci_free_statement($stid);
    oci_close($conn);
    ?>Try to provide more details.. if this is not what you are looking for.
    Hope this helps,
    Rajesh.

  • How to update two tables at the same time using jdbc

    Plz will anybody tell me what is the code or query in jdbc by which you insert entry in one table and simultaneously it goes in another table?
    Thanks in advance

    You might be
    able to design a trigger to do what you're talking
    about, but that would be a database thing, not a java
    thingAnother option would be an updatable view (google for usage), but it has limitations and should be used with caution. And yes, its a database thinggy and not java.
    cheers,
    ram.

  • Updateing oracle table Emp usering JDBC Adapter

    Hi,
    IS any one can help me what is the Format of JDBC Driver and Connection type.When we update a oracle table useing JDBC Adpater.
           Thanks in advance
    Regd's
    Raj

    Hi Raj,
    To access any Database from XI, you will have to install the corresponding Driver on your XI server.
    To install oracle driver, just check this link,
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10
    The details that have to be entered while adapter configuration if you are using the OJDBC14.jar
    The parameters should be mentioned as follows.
    Connection : <b>jdbc:oracle:thin:@<IP adress>:<listener port>:<instance name (database name)></b>
    Driver : <b>oracle.jdbc.driver.OracleDriver</b>
    Also go through these links for more information regarding the same:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/80/4f34c587f05048adee640f4c346417/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/frameset.htm
    Regards,
    Abhy

  • Updating two tables at once

    Dear all;
    I have a table called using_table with the following field
    using_id        life_length          Period
    123                   2                   years
    124                   1                   months
    125                   3                   daysnow i would like a situation whenever the life_length is updated or changed to a new number for the using_table, for instance, the 2 can be changed to 200. If that is the case, this change should be reflected on another table called info_table which has a field column called expiring date. In this table, the expiring date is bascially the mfg date + life_length (period) for that particular id. For example if the mfg date is 01/01/2010 then the expiry date is 01/01/2010 + 2 years(gotten from using_table) = 01/01/2012. Another example is if the mfg date is 01/01/2011 for that id, then expiry date is 01/01/2011 + 1 month (gotten from using_table) = 02/01/2011
    see details of the info_table below
    info_id              using_id                 mfgdate(MM/dd/YYYY)                Expiry date(MM/DD/YYYY)
    A1                       123                          01/01/2010                                    01/01/2012
    A2                       124                          01/01/2011                                     02/01/2011Any help will greatly be appreciated. Thank you.

    You will need 2 triggers for this. The code i am posting DOES NOT account for a multi-user environment. By this i mean if you have 2 users making concurrent modifications to this data YOU WILL get corrupted data. The only way to avoid that it to lock the tables before allowing access to them (the entire table). This means that only 1 session gets to make changes to this data at a time ... you can read about that here
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:474221407101
    As an aside, since you say you are new to Oracle i will share more non-solicited advice with you.
    using_id varchar2(50) not null,
    info_id varchar2(100)primary key,Don't use character data types to store numeric data. It's bad for a number of reason (all of which you can also read about on AskTom).
    Here's the code for the triggers and a simple test case for each.
    create or replace trigger i_dont_like_doing_this
    after update on using_table
    for each row
    begin
       update info_table i
          set i.expiry =
             case
                when :new.period = 'years'
                then
                   add_months(i.mfgdate, :new.life_length * 12)
                when :new.period = 'months'
                then
                   add_months(i.mfgdate, :new.life_length)
                when :new.period = 'days'
                then
                   i.mfgdate + :new.life_length
             end
       where
          i.using_id = :new.using_id;
    end;
    create or replace trigger i_still_dont_like_this
    before insert on info_table
    for each row
    begin
       select
          case
             when u.period = 'years'
             then
                add_months(:new.mfgdate, u.life_length * 12)
             when u.period = 'months'
             then
                add_months(:new.mfgdate, u.life_length)
             when u.period = 'days'
             then
                :new.mfgdate + u.life_length
          end
       into
          :new.expiry   
       from
          using_table u
       where
          u.using_id = :new.using_id;
    end;
    TUBBY_TUBBZ?insert into info_table values ('1', '125', sysdate, null);
    1 row created.
    TUBBY_TUBBZ?select * from info_table;
    INFO_ID                                                             USING_ID                              MFGDATE           EXPIRY
    1                                                                 125                              02-AUG-2010 08 45:51 05-AUG-2010 08 45:51
    1 row selected.
    TUBBY_TUBBZ?update using_table set life_length = 10 where using_id = '125';
    1 row updated.
    TUBBY_TUBBZ?select * from info_table;
    INFO_ID                                                             USING_ID                              MFGDATE           EXPIRY
    1                                                                 125                              02-AUG-2010 08 45:51 12-AUG-2010 08 45:51
    1 row selected.
    TUBBY_TUBBZ?You mentioned in another post that you will disallow modification of the EXPIRY date column by users. I don't know how you plan to enforce this, but unless you have a VERY good design methodology and lots of experience, i really don't see this happening. I'm not trying to berate you, but i remember back to when i was a beginner in Oracle (10 years ago) and that isn't something i would have been capable of.
    10 years later and there's still an exorbitant amount i don't know :(

  • Do Commit is must to update the data at receiver JDBC

    Hi friends,
        I have no live server yet, I am new to this JDBC adapter and even to XI. There is a need to develop a proxy to jdbc integration, once the server is up. I  read some forums and had an idea to do the same but, still there is a doubht tat we need to Commit the receiver side JDBC or no need? If need to commit then how it can be done.
    Thanks
    Prem

    no need to commit.it will automaticaly done.

  • UPDATE statement in Receiver JDBC adapter

    Hi all,
    I would like to use UPDATE statement in my receiver JDBC adapter and would like to know how this UPDATE statement works in following case.
    1) If i have 10 records to be updated in database, whether Commit happens at the end of all 10 records updation OR it will be for every record update?
    Regards

    Hi,
    Then let me construct my query this way...
    i have 10 records that needs to be updated to database, say For Ex: 7 records are updated successfully and 8th record has issue in updating the table.
    In this case i would like to ROLLBACK entire 10 records with out committing any thing.
    So if i use your 2nd option, it should perform as i expected right?
    Regards

Maybe you are looking for

  • My Iphone stopped ringing after my last sync

    So I synced to iTunes and I bought two ringtones. I synced them to the phone. After that, my phone only vibrates, but NONE of the rings "ring", although the settings are correct the volume is at max. I went to the genius bar at my local Apple store.

  • Handling exceptions from inputprocessor

    I'm using portal 7.0. I created a simple 2 page webflow using the ebcc wizard. The first presentation node is a form using the <webflow:validatedForm> taglib. I added the event and namespave attrbute. The event from the node is to a input processor n

  • Bugs & Improvements - Music Player - Shuffle won't shuffle past 300

    I have encountered a bug and experiences of major lag functionality while using the Music player. 1. Shuffle appears to not want to shuffle past the #300. It continually bounces around in numbers under that mark no matter what category I'm in and I h

  • Drag & drop stops working when I drag outside the top-level window

    I have implemented drag & drop in my application, using the pre-JDK 1.4 approach. It works fine until I drag outside the top-level window, then back in again. My drop target receives a dragExit, but doesn't get a dragEnter when I drag back in. It the

  • Getting A Count In One SQL Statement

    Since I don't know how to do what I'm about to ask, I would normally create a table (tbl1) with the main dataset I want and then create a second table (tbl2) with additional data I want, join the two and update tbl1 data with tbl2 data. However, I wo