JOIN in UPDATE  using JDBC  receiver

Hi All
The scenarios is as follows :
I have to implement,updation of a flag in a table where the  column names in the WHERE clause are from two different tables in the same database.
i.e
UPDATE T1
Set T1.flag =1
where T1.columnA=value1  and T2.columnB=value2
where T1 and T2 are tables in the same database,
and the values (value1 and value 2 ) are provided to XI by SAP based on which the flag need to be updated in T1
one way is to write a stored  procedure specifying the join and call it in XI,
I want to accomplish this directly using SQL statement  from XI
Is  that  possible  ???
kindly reply
thanks
sd

Hi Sd,
You can execute an SQL statement directly in your Receiver JDBC adapter.
Check this link for that,
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Check the part for STATEMENTNAME6 and also the example for that in the same link,
Regards,
Bhavesh

Similar Messages

  • Error while updating database using jdbc receiver adapter

    Hi All,
    I am trying to update a single record using jdbc receiver adapter.
    This is my the message that is getting created..
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:Data xmlns:ns0="urn:Test">
    - <STATEMENT>
    - <TABLENAME ACTION="UPDATE_INSERT">
      <TABLE>ORDERS</TABLE>
    - <ACCESS>
      <OrderID>99999</OrderID>
      <CustomerID>VICTE</CustomerID>
      <EmployeeID>3</EmployeeID>
      <ShipAddress>VICTE</ShipAddress>
      </ACCESS>
    - <KEY>
      <OrderID compareOperation="EQ">99999</OrderID>
      <ShipAddress compareOperation="EQ">VICTE</ShipAddress>
      </KEY>
      </TABLENAME>
      </STATEMENT>
      </ns0:Data>
    But in Adapter Monitoring i am getting the following error..
    <i>Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'ORDERS' (structure 'STATEMENT'): java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'VICTE'.</i>
    Regards,
    Rahul

    Rahul,
    > In this case i believe the interface has to be synch.
    > So what will the response message type be like..
    Not necessary. UPDATE can be asynch as well.
    Can you turn the trace on like pointed by Michal and then you can see the Query in the Audit Log of the adapter montioring. Try to execute the same query from your DB Client like TOAD and see what is the Syntax error you are getiing.!
    The problem looks like some field has some dataype / column name mismatch.
    Regards
    Bhavesh

  • How many messsages can we insert using JDBC receiver adapter in to DB

    Hi Friends,
    We are having 30 JDBC receiver interfaces in my current implementation project; load of JDBC receiver interfaces was 50 k messages per day and Performing only INSERT operation on data base.
    We have created individual communication channel for every JDBC receiver interface and max concurrency value set in CC was 5.
    Now we are testing all interfaces in quality with all possible cases, but we found that JDBC receiver adapter unable to process 50 k messages per day, we are on PI 7.1 EHP1 SP7.
    Please share your experiences with JDBC adapter receiver like per day how many messages we can transfer.
    Thanks a Ton,
    Raj

    Raja Sekhar Reddy T wrote:
    we are processing 50 k individual messages.
    >
    > I have increased max threads for JDBC receiver to 20 but no luck same rate only . My questions here is how many messages we can trasfer using JDBC receiver adapter?
    >
    > Regards,
    > Raj
    Hi raj,
    I have seen some interfaces that deal with upload of 5000 rows at a rime.. I don't there will be a restriction in the no of messages that can be transferred using the JDBC adapter as such  unless until the requirement is so para-normal and in your case it is not
    Kind regards
    XA

  • Executing Select query using JDBC Receiver Adapter

    I created couple types in Oracle and also new function instead of procedure
    Can I execute the above query using JDBC Receiver Adapter.
    select *
    from  the ( select cast( apr.get_distribut('', '', '', 'hdfcgd', 'CAN') as dsrTable )
             from dual );
    If possible how my message structure should look like...

    Hi vikram,
       If you use JDBC as Receiver Adapter you can only post the data to the data base I do no think so we can select the records from the data base.
       If you use JDBC as Sender hope,we can the select query in the sender communication channel.
        Hope I am clear.
      Thanks and Regardds,
      Chandu.

  • Error while using Jdbc receiver adapter

    Hi,
    Iam using a receiver jdbc adapter to update a table in my database.Here iam using 'UPDATE' as my action in the mapping.It is giving the foowing error....
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)
    Can Please anybody tell me what may be the problem with my scenario...
    Thanks & Regards,
    Radhika.

    Hi ,
         action type should be attribute .  Please go through the following structure for update .
    <b>
       <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_RESPONSE xmlns:ns1="http://com/Test">
       <STATEMENT_NAME>
          <TABLENAME action="UPDATE">
             <TABLE>Utility</TABLE>
             <access>
                <Updated_On/>
             </access>
             <key>
                <TrnHisID/>
             </key>
          </TABLENAME>
       </STATEMENT_NAME>
    </ns1:MT_RESPONSE></b>
              query for above we may say as
    <b>UPDATE  Utility set  Updated_On='' where  TrnHisID =''</b>
              Hope it helps
    Regards.,
    V.Rangarajan

  • Updating in JDBC receiver adapter

    Hi Friends,
         I came across in the some sdn blogs, Like JDBC to JDBC scenarios i found that in the receiver JDBC adapter there is no place to write update statement or insert statement.Then how the records get updated in the DB.
    My actual need is to update the oracle db from sap, which currently using the following statement
    Loop at it_trn_ctl into WA_TRN_CTL.
    UPDATE TableA SET SAP_UPDATE = 'Y'
                                      WHERE PARENT_ID = :WA_TRN_CTL-PARENT_COIL .
    end loop.
    should replaced by XI, using the proxy to jdbc receiver. Where i can write the update statement and the where condition.
    Kindly revert back for queries.
    Thanks in advance
    Karthikeyan

    hi
    for updation no need to write any query,use update structure at reciever side
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
    this contains action:udate and then
    key1: field that u want to update.
    key2:pass old value of field for matching(where conditon matching field)
    Edited by: Dharamveer Gaur on Sep 19, 2008 8:40 AM

  • Want to save time while doing inserts or updates using JDBC

    I want to save time while doing inserts/updates in a database in my Java app. using JDBC. My app. has to do a lot of inserts and that takes up a lot of time.
    I can do some buffering and then do bulk/batch inserts if that will help. any pointers on whether this will be useful and how to go about it?
    Is there any other way I can save time and thereby improve performance?
    I am using Oracle 8 with Oracle thin driver.
    Thanks

    I tried using the PreparedStatement.addBatch() and PreparedStatement.executeBatch() in a test program.
    The error is SQLException - "Unsupported feature" which I get at the addBatch method call. I am using oracle thin driver sdk 8.1.6 for jdk 1.2.x
    What is wrong here?
    Thanks

  • How to Insert all Records together using JDBC Receiver Adapter.

    Hi,
    Suppose, I have to send 5 records and from R/3
    (using client Proxy) using XI and insert/update all these records in a database.
    In case I want to update all the 5 records else mark it as fail and return the response synchronously to R/3, what should be my approach?
    Can we do it using native sql querries, if yes could you plese tell me how to do so.
    I have never used native sql queries.
    Thanks in advance.
    Regards
    Pushkar

    hi,
    >>>>Can we do it using native sql querries, if yes could you plese tell me how to do so.
    why don't use use standard jdbc adapter and standard jdbc document formats?
    the sync jdbc call will return the number of affected /deleted rows
    Regards,
    michal

  • Useing  a Idoc  an  Oracle  database Can be update useing JDBC Adapter

    Hi Guys,
    Can you help me on the above topic..
    Regd's
    Raj

    Hi Raj,
    You can use the Idoc Adapter on the sender side and JDBC on the reciever side. After you have configured your scenario, you should be able to write data into the oracle database.
    For the strucutre of your Datatype for insertion , just check this link,
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    To access any Database from XI, you will have to install the corresponding Driver on your XI server.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10
    Or on the JDBC end you can write a stored procedure to make your data update more efficient.
    Go through this blog for stored procedures.
    /people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
    I hope this helps.
    Regards,
    Abhy

  • Inserting into two tables using JDBC Receiver Adapter

    I've defined following type for Receiver JDBC to save data in two different tables
    Name          Category     Type          Occurrence
    ReceiverDB_DT     Complex Type          
    STATEMENT     Element                    1..unbounded
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table1_DT     1
    STATEMENT2     Element                    1..unbounded
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table2_DT     1
    When I send data of two tables, it is showing data for both the two tables in MONI of PI System, but ultimately it shows only one table's data in message monitoring payload.
    what could be the problem?
    Thanks,
    -Haresh

    It solved!!!
    by just changing Occurrence only as rightly pointed by Ankesh
    Name          Category     Type          Occurrence
    ReceiverDB_DT     Complex Type          
    STATEMENT     Element                    1..unbounded
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table1_DT     1
    STATEMENT2     Element                    1..unbounded
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table2_DT     1
    Name          Category     Type          Occurrence
    ReceiverDB_DT     Complex Type          
    STATEMENT     Element                    1
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table1_DT     1..unbounded
    STATEMENT2     Element                    1
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table2_DT     1..unbounded
    Thanks a lot ankesh

  • Batch Updates using JDBC 2.0

    Dear all,
    I am trying to use a PreparedStatment's batchUpdate() method. Here is the problem.
    I get an exception if there is a duplicate entry, and that blows up the entire batch. This leaves me with no room for error checking as to where this error had occurred.
    How do I know at which row I got the error? How can I make the batchUpdate() execution to ignore the error and continue?
    Thanks,
    -rrvvg

    This is a case where reading the Java documentation will help you. Here is the link to
    int[] executeBatch() throws SQLException.
    http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Statement.html#executeBatch()
    I know this isn't code showing you how to do it, but I think it does a good job of explaining how to handle your situation. The documentation clearly states that you also need to see the documentation of your specific JDBC driver because Exception behavior is defined by the driver and can be different between vendor offerings..

  • How to modify oracle stored procedure for JDBC Receiver Adapter?

    Hi all.
    This is Urgent.
    Scenario is
      SELECT a TABLE with procedure and update column with it,
      then send data to SAP System with RFC Adapter.
    When I executed a sync bpm, scenario was finished internal error.
    Pls, let me know how to correct procedure using JDBC Receiver Adapter?
    Regrds all.
    Procedure Code -
    SET SERVEROUTPUT ON
    CREATE OR REPLACE PROCEDURE zwtn2
    IS
       v_seller_company      wtnivhd.seller_company%TYPE;
       v_invoice_no      wtnivhd.invoice_no%TYPE;
       v_report_date     wtnivhd.report_date%TYPE;
       v_customs_date     wtnivhd.customs_date%TYPE;
       v_ap_post_date     wtnivhd.ap_post_date%TYPE;
       v_gr_date          wtnivhd.gr_date%TYPE;
    CURSOR l_cursor IS
       SELECT seller_company,
              invoice_no,
              report_date,
              customs_date,
              ap_post_date,
              gr_date
         FROM wtnivhd
        WHERE wtn_send_flag = 'N'
          AND rownum < 31
    FOR UPDATE;
    BEGIN
       OPEN l_cursor;
       LOOP
         FETCH l_cursor
          INTO v_seller_company,
               v_invoice_no,
               v_report_date,
               v_customs_date,
               v_ap_post_date,
               v_gr_date;
         EXIT WHEN l_cursor%NOTFOUND;
         UPDATE wtnivhd
            SET wtn_send_flag = 'Y' 
           WHERE CURRENT OF l_cursor;
       END LOOP;
    CLOSE l_cursor;
    END zwtn2;

    Hi Alex,
    plz have a look to Runtime Workbench / Adapter Monitoring to find an error message.
    Regards,
    Udo

  • Update in JDBC Sender adapter for more than one table

    Dear Friends,
              I have to select more than one table in the JDBC sender using the join condition. But i found that update statement is also mandatory in the sender comm channel. I am not going to update any flag after the select but as it is mandatory, i have decided to use the following update statement which wont effect the existing data UPDATE <tablename> set flag = ' ' where flag = ' '.
    But in my case i have 3 tables, do i need to update stmts for all the three tables.
    if yes how can i do the same.
    plz revert back i u couldnt get the queries.
    Thanks
    Prem

    HI
    UPDATE T1
    Set T1.flag =1
    where T1.columnA=value1 and T2.columnB=value2
    where T1 and T2 are tables in the same database,
    and the values (value1 and value 2 ) are provided to XI by SAP based on which the flag need to be updated in T1
    write a stored procedure specifying the join and call it in XI.
    For doing it in SQL statement only reffer to the below link ..sur you will get help .
    Multiple records update using JDBC
    Regard's
    Chetan Ahuja

  • Worry about the JDBC Receiver process behavior

    Hi, All.
    I meet this situation. Use JDBC receiver to select datas from DB2 and after that update these datas which just were selected with a read mark. I use two statements, one is select, another is update.
    What if when between the selecting and the updating, another transaction inserts datas into the table. Is this situation leads to a difference in the operation set of datas between selecting and updating. If this problem really exists, is there any method to solve it.
    Looking forward to your guys ideas.
    alex

    Hi,
    I agree JDBC receiver adapter has the same options too, but, you need to understand that this Transaction Handling will be for only one STEP of the BPM.
    If you are going to Select and Update the Database using a single Message ( making one single call with multiple STATEMENT level tags each for Select and Update ), then transaction handling will work.
    But, if you are going to select data from the DB using a Send Synch Step in the BPM and then again in a SEPARATE step update the datatabase, then the transaction handling will not help.
    Hope this clears ,
    Regards,
    Bhavesh

  • JDBC Receiver adapter-java.sql.SQLException: ORA-00904: "BATCH_ID": invalid

    Hi
    I am trying insert rows in Oracle database using JDBC receiver adapter setup in PI 7.1. However this receiver adapter is throwing following exception.
    Delivering the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PRADEEP_OTC_ORDERS' (structure 'statement'): java.sql.SQLException: ORA-00904: "BATCH_ID": invalid identifier .
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:mt_sql_writer xmlns:ns0="http://rdbms_poc">
    <statement>
         <dbtablename action="INSERT">
                <table>PRADEEP_OTC_ORDERS</table>
              <access>
                     <order_id>19126</order_id>
                     <version>1</version>
                     <batch_id>132</batch_id>
                </access>
           </dbtablename>
    </statement>
    </ns0:mt_sql_writer>
    PRADEEP_OTC_ORDERS table has just 3 columns as specified the access segment. However I stil get this ORA-00904 error message.
    Any idea on what could be wrong.?
    Thanks
    -Pradeep

    Hi All,
    Thanks a lot for responding...
    I verified the table structure, table just contains those 3 coulms all varchar type.
    I modified the column name as well, But was still getting ORA-00904. Then I went directly to the the database and executed below insert statement,
    insert into PRADEEP_OTC_ORDERS (mps_order_id, mps_version,mps_batch_id) Values(1,2,3)
    I got exact SQL Error: ORA-00904: "MPS_BATCH_ID": invalid identifier.
    So ISAP JDBC adapter is not enclosing the string values in quotes.
    SAP documentation says it puts quotes for values and treats everything as string(text).
    Anybody has any idea, why JDBC receiver adapter not enclosing the values in quotes?
    Thanks
    -Pradeep

Maybe you are looking for