Joins implementation receiver Jdbc Adapter

Hi All
I need  some suggestions on the following scenario
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 two different tables in the same database,
I want to accomplish this directly using UPDATE in JDBC receiver by using JOIN query in the structure.
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

  • Receiver jdbc adapter:how to implement the insert or update action in a sql

    Hi,gurus:
    I'm using receiver jdbc adapter now.
    You know, we have to gave the action the value 'update' or 'insert',but in our case,the action is variant--update or insert.It decides whether the record exists in the outer database.
    Can stored procedure do this?If I use stored procedure,then must I create a stored procedure in the outer database?
    Or some other ways to solute my issue?
    THanks in advance.

    Hi
    Use Action UPDATE_INSERT .
    This action check if a record exist with same key value then update that record. In case no record with key value found in database then record inserted to database.
    look receiver structure
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

  • Table name in Receiver JDBC Adapter

    Hi All,
    I am using receiver JDBC adapter.
    But table name consist of " like BPC."#II" .
    After mapping table name becomes BPC."#II" .
    I am getting error while pulling data from DB.
    Is the table name creating a problem.
    Please remedy of this if you have come across such scenario.
    Regards
    Piyush

    Hi Piyush,
    All that i could get from the SAP Help regarding JDBC Adapters are these links where i never found anything much regarding the table name.anyways just go through these links and see if you find anything useful.
    http://help.sap.com/bp_bpmv130/Documentation/Planning/XIUnicodeGuide030411.pdf
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/content.htm">Configuring the Receiver JDBC Adapter</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0/content.htm">Mapping Lookups</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/content.htm">JDBC Adapter</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm">Configuring the Receiver JDBC Adapter - part 2</a>
    This is all i got from the help files, anyways you can also go through those links and see if you find anything else useful.
    - Escape Symbol for Apostrophe
    The apostrophe character (‘) is a reserved character in SQL syntax and is therefore replaced by an escape character if it occurs within value strings. This replacement character can be database-specific. Typical replacement characters are \’ or ’’(default value). If a character occurs that is invalid for the database being used, the adapter triggers an error message (an SQL exception) concerning the SQL syntax that is generated by the database.
    - Column Name Delimiter
    Depending on the database being used, column names can be enclosed by a special delimiter character, for example, if the names can contain special characters (such as ”). This character can be specified at this point. The default setting is no delimiter character. If a character occurs that i
    Also check if there are notes in the service market place related to the same.
    Regards,
    abhy
    Message was edited by: Abhy Thomas

  • How to handle BLOB field in receiver JDBC adapter into ABAP table

    Dear Experts,
    I am working in a synchronous scenario with Sender ABAP Proxy to Oracle Database as receiver via SAP PO 7.4.I will be calling a stored procedure view with fields ID, NAME,Age,*** and BLOB (Image binary).
    1. The response from Oracle Database field BLOB is to be stored in ABAP table.Would I have to write any JAVA program to read the BLOB or the receiver JDBC adapter will handle it and store in a table by using ABAP proxy once it reaches ECC.
    2. If yes, would the JAVA program have to deal with other 4 fields.
    3. Can I use a UDF mapping to this BLOB field.
    Regards
    Rebecca...

    Dear Praveen,
    Thanks for your response...
    Please correct me if I am wrong.
    1. For 1-1 response mapping for BLOB field, I will use just use the below UDF code.
    public static byte[] hexStringToByteArray(String s) { 
                int len = s.length(); 
                byte[] data = new byte[len / 2]; 
                for (int i = 0; i < len; i += 2) { 
                            data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) 
                                                                                         + Character.digit(s.charAt(i+1), 16)); 
                return data; 
    2. ===Using the byte data, create binary attachment in mapping for abap proxy response===
    Could you please share how to create the binary attachment.. I am not clear
    Regards...

  • Sync Receiver JDBC Adapter

    Hi All,
    I was trying to make a synchronous call to a receiver jdbc adapter with the help of
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3928. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    I am getting the following error in jdbc adapter.
    <i>com.sap.aii.af.ra.ms.api.DeliveryException: ERROR:Processing request: Error when executing statement for table/stored proc. 'MISDetails': java.sql.SQLException: FATAL ERROR document format: structure 'STATEMENT', key element 'FiscalYear' contains no values</i>
    My Source message is
    <i><?xml version="1.0" encoding="UTF-8"?>
    <ns:MT_FILE_OUT xmlns:ns="urn:ters">
      <REQUEST>
        <FISCALYEAR>2007</FISCALYEAR>
        <YEARMONTH>1</YEARMONTH>
        <OPERATION>EQ</OPERATION>
      </REQUEST>
    </ns:MT_FILE_OUT></i>
    And JDBC request message is ..
    <i><?xml version="1.0" encoding="UTF-8"?>
    <ns:MT_JDBC_REQ xmlns:ns="urn:ters">
    <STATEMENT>
    <TABLENAMEACTION="SELECT">
    <TABLE>MISDetails</TABLE>
    </TABLENAME>
    <ACCESS>
    <FiscalYear> </FiscalYear>
    <YearMonth> </YearMonth><ProductCode> </ProductCode><TargetVolume> </TargetVolume>
    </ACCESS>
    <KEY>
    <FiscalYear compareOperation="EQ">2007</FiscalYear>
    </KEY>
    </STATEMENT>
    </ns:MT_JDBC_REQ></i>
    Regards,
    Sumit

    Sumit, the problem is that </TABLENAME> is closed ealier than necessary.
    This is how the JDBC datatype should be,
    <?xml version="1.0" encoding="UTF-8"?>
    <ns:MT_JDBC_REQ xmlns:ns="urn:ters">
    <STATEMENT>
    <TABLENAME ACTION="SELECT">
    <TABLE>MISDetails</TABLE>
    <ACCESS>
    <FiscalYear> </FiscalYear>
    <YearMonth> </YearMonth>
    <ProductCode> </ProductCode>
    <TargetVolume> </TargetVolume>
    </ACCESS>
    <KEY>
    <FiscalYear compareOperation="EQ">2007</FiscalYear>
    </KEY>
    <b></TABLENAME></b>
    </STATEMENT>
    </ns:MT_JDBC_REQ>
    The TABLE, ACCESS and KEY come under the TABLENAME tag.
    Regards,
    Bhavesh

  • Messages are in hold state due to one message at receiver JDBC adapter

    Hello,
    I am using a receiver JDBC adapter and trying to send an XML file which has an insert query to insert some data into the database i.e., Oracle 9i.
    Here at the receiver side due to one message (  which is in to be delivered state) all other messages are got hold and waiting for long time.
    I am getting the exceptions as this,
    JDBC Adapter processing failed with Error processing request in sax parser: Error when executing statement for table/stored proc. 'FSASMGR.XTBL_KL06_IINQUIRY' (structure 'REC01'): java.sql.SQLException: ORA-12899: value too large for column "FSASMGR"."XTBL_KL06_IINQUIRY"."CASE_TITLE" (actual: 81, maximum: 80)
    Exception caught when executing statement for table/stored proc. 'FSASMGR.XTBL_KL01_ISTAFF_MST' (structure 'REC1'):
    java.sql.SQLException: ORA-00001: unique constraint (FSASMGR.XTBL_KL01_ISTAFF_MST) violated
    Can anyone help me out in solving this issue.
    THanks,
    Soorya

    hi surya,
    jdbc channel tries a request for n number of times(no of rettries),if that request fails it will take up the following requests,its not like it will process a request forever.
    to be delivered will be resulting if reciever is down or network between XI and database server is bad.
    try to ping databse server from XI host system.
    if everything is fine then look at the channel configuration->advanced->no of retries of database transaction on sql server.
    just redue the count to 1 and recheck.
    Regards,
    rama Krishna

  • Multiple table insert using receiver jdbc adapter

    Hi,
    I am trying to insert data in to two tables in a single structure using receiver jdbc adapter. I am not using any stored procedure to insert data instead directly inserting the data using PI. Please see the structure I am using.
    SOURCE side:
    DT_ABC_SENDER
    --IT_HEADER_TEXT
      -- EBELN
      -- LINENO
      --TDTEXT
    --IT_ITEM_TEXT
      -- EBELN
      -- LINENO
      --TDLINE
    TARGET side:
    DT_ABC_RECEIVER
    --InsertStatement
         --HEADER_TEXT
                -- action                         (insert)
                -- Table                          (Table 1)
                --access
                     -- IDS_ENQ_NO
                     -- IDS_DESC
                     -- IDS_TEXT
       --ITEM_TEXT
                -- action                         (insert)
                -- Table                          (Table 2)
                --access
                     -- IIS_ENQ_NO
                     -- IIS_DESC
                     -- IIS_TEXT
    Using the above structure I am able to successfully insert the data in Table 1 but data is not getting inserted in Table 2.
    In sxmb_moni it is saying message successfully delivered but I but there is data insertion took place in Table 2.
    Please help me urgently.
    Thanks in advance.
    Neeeraj

    Hi Neeraj,
    Add --InsertStatement statement for the second table structure in the same level of first InsertStatement.
    Target structure like this:
    DT_ABC_RECEIVER
    --InsertStatement
         --HEADER_TEXT
                -- action                         (insert)
                -- Table                          (Table 1)
                --access
                     -- IDS_ENQ_NO
                     -- IDS_DESC
                     -- IDS_TEXT
    --InsertStatement
       --ITEM_TEXT
                -- action                         (insert)
                -- Table                          (Table 2)
                --access
                     -- IIS_ENQ_NO
                     -- IIS_DESC
                     -- IIS_TEXT

  • When would you write a stored procedure in sender/receiver jdbc adapter

    Hi Everybody
    Can you tell any situation where you would need to write a stored procedure in the query sql statement of sender/ receiver jdbc adapter instead of writing SELECT statement there
    why do we need to write stored procedures
    thanks and regards,
    Anitha

    Hi Anitha,
    why do we need to write stored procedures
    Some times a single SQL statement will not suffice for ur transactions....
    Say u want to access from 2 tables and update based on some condition..
    or nested select statement...
    or u want to update a 2 nd table based on the values from 1st table... etc..
    In those places it's preferable for going for a Stored Procedure.
    The Stored Procedure can be used in both Sender and Receiver JDBC Adapter.
    Still nt clarified do post..
    Babu

  • Using Stored procedure in sender or receiver jdbc adapter

    Hi All,
    Please let me know simple blogs for Stored procedure used in sender or receiver jdbc adapter to get data from 2-3 tables
    Thanks

    Hi
    To work with Store proceudres (SP) you have to create the SP's in database like Oracle, Mssql or Msaccess.
    Ususally the SP creations are done by database experts. For more info about "SP" try Googling!
    The below blog is about SP but not the one you expect!
    /people/itisha.alok/blog/2009/03/23/jdbc-stored-procedure-returning-multiple-resultsets
    Executing an Oracle Stored Procedure from Sender JDBC adapter
    Sender Adapter - -
    SP will contain the select Query alone or with it will contain insert, delete statement too.
    Receiver:
    SP will have insert or delete satement.
    Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm
    The below details are required  to configure the adapters
    Driver details
    database name
    Procedure name
    user name
    password,
    Regards
    Ramg

  • Problem in Receiver JDBC Adapter

    Hello Gurus,
    I am trying SAP -> Oracle Database Scenario.
    Where i am passing Id and Email address into the Oracle.
    In Runtime workbench, Receiver JDBC adapter Channel, i am able to see that message is in Success.
    But if i am going into the Database and looking for that Record, it is not updating that record.
    I am not able to understand what is happening.
    Please help me out in this issue.
    Thanks,
    Akhil

    HI Akhil,
    I know you might have verified alll datat hat will be passing to JDBC...but may I kindly request you to confirm about the table name that was passed in the Mapping once again.
    While inserting or Updating are you using all the Key fields..that will allow you to create the unique entry..as if in case if the record is already exists then there may be problem of Indexing...of adding duplicate entry...and due to partial key fields Update statement will not work properly..
    Also verify the ORACLE  Database log...to get anymore details.
    Thanks
    Swarup

  • Dml in Receiver JDBC ADAPTER

    Dear all,
    By putting action=Insert in the Receiver Structure ,I could able to insert the data.
    When I am Trying Delete or Update in the Same way I could not see the data modified in the table.
    Please Let me know how to achieve the same.
    Thanks,
    Srinivas

    Hi,
    go thru these links:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm
    Also have alook at this
    Receiver JDBC
    /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
    /people/ajay.kumar/blog/2005/03/24/writing-bsp-for-sap-r3-version-46
    /people/sugree.phatanapherom/blog/2005/08/14/configuring-sld-in-sneak-preview-sap-netweaver-04-sneak
    /people/sanyam.kapur/blog/2005/04/30/custom-fields-and-bw-extractors-making-a-mixed-marriage-work-part-ii
    Regards,
    Akshay Jamgaonkar.
    Reward points if find useful.
    Message was edited by:
            Akshay Jamgaonkar

  • What are the Batch mode parameters for Receiver JDBC Adapter

    Hi All,
             Could some pls tell me how to set bacth mode in receiver JDBC adapter and what are its parameters and how to configure them. i beleive there is something like max count parameters etc..
    Regards,
    Xier

    Hi,
    Check this for more info
    http://help.sap.com/saphelp_nw04s/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    Regards
    Seshagiri

  • 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

  • ABAP client proxy With Receiver JDBC Adapter

    Hello Experts,
    I am working on a scenerio ABAP client proxy With Receiver JDBC Adapter.
    The client proxy program will fetch the master data related to equipment in plant maintenance module and  will update the sql database through Receiver JDBC Adapter .
    my requirement is if the equipement is created in sap then the  scheduled job has to trigger the client proxy program and send the message with status 'created'  to sql data base.
    if the equipment is modified in sap then the scheduled job has to trigger the client proxy program and send the message with status 'modify' to sql data base.
    please let me know how can i write the logic/code for this scenerio in client proxy program.
    Tables for equipment master i am using  is EQUI and fields are   ERDAT and AEDAT which is created date and modified date.
    fields for scheduling start date is tbtcp-sdldate.
    Thanks in advance.
    Ram.

    Hello Ram,
       Here you can check if updated date field is not empty then send status as created and if this field is not blank then send status as modified record.
    Monica

  • Specify Keys in Data Type for receiver JDBC adapter

    Hi guys,
    I have the following issue:
    In a proxy to JDBC scenario, I want to specify somehow the key values for the SQL statement in the data type that I define for the receiver JDBC adapter. Thus, I am using the following structure in data type:
    root
        Statement
               dbTable
               action
               table
               access
                      CustomerID
                      Name
                      HouseNo
               Key
                      CustomerID
    But in the SQL statement that is produced (I can see that in RWB, CC Monitoring, Audit Log), the "Key" segment is translated into "OR". E.g. UPDATE_INSERT ("A100" "Evaggelos Gkatzios" "El Alamein 19") OR ("A100")
    Do you have any ideas ?

    Hi,
    Its clear from the statement in RWB (in CC monitoring's auditlog) you are using UPDATE_INSERT as the action.
    Please correct me if this is OK. Now the interpretation of input xml file will be like this,
    If the input XML is in the following format
    <root>
    <Statement>
    <dbTable action=UPDATE_INSERT>
    <table>EXAMPLE</table>
    <access>
      <CustomerID>ABC</CustomerID>
      <Name>xyz</Name>
      <HouseNo>123</HouseNo>
    </access>
    <key>
      <CustomerID>DEF</CustomerID>
    </key>
    </dbTable>
    </Statement>
    </root>
    Resultant SQL after parsing the XML file will be,
    1. It will first check with the condition WHERE CustomerID = DEF. If it finds the record with this condition then it will update the record with CustomerID=ABC, Name =xyz & HouseNo=123.
    2. If it doesn't find any record with that CustomerID then, it will insert a new record with the same details.
    In auditlog, you will find two SQL statements like,
    1.UPDATE EXAMPLE SET CustomerID=ABC, Name =xyz & HouseNo=123 WHERE CustomerId=DEF
    2.INSERT INTO EXAMPLE VALUES(ABC,xyz,123)
    hope this has given clear information about your query,
    Regards,
    Soorya

Maybe you are looking for