JDBC receiver - INSERT issue

Hi all.
Let's assume I have a document with a number of INSERT statements :
- <p2:XXX xmlns:p2="http://abc.com">
- <UPDATE_INSERT>
- <IN_MAT action="INSERT">
  <table>MY_TAB</table>
- <access>
  <MANDT>030</MANDT>
  <WERK>LW01</WERK>
  <MATNR>PFS</MATNR>
  <INTIME>04.07.2005</INTIME>
  <MATTYP>0012</MATTYP>
  <MATXT>PFS</MATXT>
  <GMIEN>PJM</GMIEN>
  <RATIO>0000000001.000</RATIO>
  </access>
  </IN_MAT>
  </UPDATE_INSERT>
- <UPDATE_INSERT>
- <IN_MAT action="INSERT">
  <table>MY_TAB</table>
- <access>
  <MANDT>030</MANDT>
  <WERK>LG01</WERK>
  <MATNR>HPL</MATNR>
  <INTIME>16.06.2005</INTIME>
  <MATTYP>0013</MATTYP>
  <MATXT>HPL</MATXT>
  <GMIEN>ARK</GMIEN>
  <RATIO>0000000005.330</RATIO>
  </access>
  </IN_MAT>
  </UPDATE_INSERT>
Is there any way to process them in separate way. I mean
that in case of failure (for any reason) in one INSERT
rest of them wasn't rolled back??
I guess, that usually a whole XML message is rolled back.
Am I right?
Regards,
    Grzegorz.

Just a wild option...:) ..
i think it will work...but it may not be a very pretty one...Just thinking along the lines of having a commit after every statement...Your message would be something like this...
- <p2:XXX xmlns:p2="http://abc.com">
- <UPDATE_INSERT>
- <IN_MAT action="INSERT">
<table>MY_TAB</table>
- <access>
<MANDT>030</MANDT>
<WERK>LW01</WERK>
<MATNR>PFS</MATNR>
<INTIME>04.07.2005</INTIME>
<MATTYP>0012</MATTYP>
<MATXT>PFS</MATXT>
<GMIEN>PJM</GMIEN>
<RATIO>0000000001.000</RATIO>
</access>
</IN_MAT>
</UPDATE_INSERT>
<Commit_STAT>
<docommit action="SQL_DML">
<access>COMMIT WORK</access>
</docommit>
</Commit_STAT>
- <UPDATE_INSERT>
- <IN_MAT action="INSERT">
<table>MY_TAB</table>
- <access>
<MANDT>030</MANDT>
<WERK>LG01</WERK>
<MATNR>HPL</MATNR>
<INTIME>16.06.2005</INTIME>
<MATTYP>0013</MATTYP>
<MATXT>HPL</MATXT>
<GMIEN>ARK</GMIEN>
<RATIO>0000000005.330</RATIO>
</access>
</IN_MAT>
</UPDATE_INSERT>
<Commit_STAT>
<docommit action="SQL_DML">
<access>COMMIT WORK</access>
</docommit>
</Commit_STAT>
Thanks & Regards,
Renjith

Similar Messages

  • JDBC Receiver Select issue

    Hi,
    in the scnario soap to jdbc i am selecting records from oracle database from the soap request and response as to be sent back to soap.
    here i am getting this error as
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'Statement'): java.sql.SQLException: FATAL ERROR document format: structure 'Statement', key element 'DATA_COMPLETE' contains no values
    even i have checked the blog /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    kindly suggest
    Regards
    Vijay

    for this i noticed that there are no columns in the statement...
    now to mapp this column names in request as i get only one field as input so that i can only htat filed ..
    Map that field itself to the target structure.....the values in the column wont be populated automatically.
    If the one source field contains concatenated value then using substring populate target columns accordingly.
    Regards,
    Abhishek.

  • JDBC Receiver - Insertions

    Hello all,
    I want to use JDBC adapter to insert data in an Oracle database. Inbound message is an idoc.
    My question concerns the error handling following an insertion failed. Example : entry key already exists...
    If possible I want to use asynchronous interface without BPM. I see the JDBC adapter ability to execute more than one time the query... Once last retry mechanism fails, how does XI react ? Is The message considered as an error one ?
    Is it possible to reprocess it later ?
    Thanks in advance,

    Hi,
    <i>
    Once last retry mechanism fails, how does XI react ? Is The message considered as an error one ?</i>
    >>>After last retry it will go for failure status..
    To handle errors :
    1) Using Sync Interface- here you can use stored procedure also for this. SO in this case, JDBC adapter will give you the response back
    2) To handle alert for the Adapter level-if you want to handle errors , you can go with either Adapter Alerts without BPM. If any error in the adapter level , because of insertion failure it will throw alert.
    3) With BPM -Send with Acknowledgement.
    Hope this helps,
    Regards,
    Moorthy

  • JDBC Sender to JDBC Receiver || Acknowledgement

    Hi Experts,
    the scenario is the following:
    JDBC sender to poll a database and receive data from table a (Query SQL Statement)
    after the mapping, a JDBC receiver inserts the resultset from a into table b.
    okay, so far, now the action is done and the sender adapter has to delete the resultset from table a (with the Update SQL Statement)
    the problem is now how to ensure that only the resultset is deleted from a IF its really inserted into b? means: how to tell any adapter that the update-command is only done when the insert worked correctly?
    thanks in advance
    Chris

    First of all, u will have to make an async call from JDBC. The scenario wouldn't be that good in design :).
    The only thing to be taken care should be the poll interval. It should be large enough so that the BPM processing is complete otherwise the polling of same data will occur twice. (U may use Planning Availability Times concept here).
    I understand that the UPDATE statement is mandatory
    U can write Test to just don't update anything.
    Now the data would be sent to receiver and after the successful receipt at receiver, BPM send step would be triggered with the update statement to actually update the table.
    Hope it makes everything clear
    Regards,
    Prateek

  • Issue with processing time of JDBC receiver adapter

    Hi all,
    We are using PI 7.1 EHP1.
    We have an issue with JDBC receiver adapter taking too much time to process messages.
    We are using XML SQL format message protocol with INSERT_UPDATE as the document format.
    Each message can contain multiple records, i.e. 1 single message can result in many updates/inserts.
    Currently, time taken to process in 6-12 secs which is quite high considering the messages are not very large in size.
    We sent the statements to Oracle DBA to see if anything about the queries being used is causing issues. Awaiting inputs.
    In the mean time, wanted to check if there is anything that can be done from PI side that will help us improving the processing time.
    Thanks in Advance,
    Sailaja.

    Hi,
           i think the main cause is  query taking long time to execute in DataBase.
          -> increase the read time and response time in the JDBC receiver adapter.
      In the advanced mode table section of sender channel and receiver channel configurations, we can set driver properties for each DB connection. Any such property would have to contain prefix 'driver:'(with out quotes).
    For Oracle Database JDBC thin driver 10.2.0.3 version, the property oracle.jdbc.ReadTimeout helps to set read timeout while reading from the socket. Also for setting login time out in Oracle, we use oracle.net.CONNECT_TIMEOUT. To set these two properties use as follows: driver:oracle.jdbc.ReadTimeout 1000 driver:oracle.net.CONNECT_TIMEOUT 1000 The TimeOut Driver properties like ReadTimeout and CONNECT_TIMEOUT are in milliseconds.
    Refer note 1078420 for more details
    please go through this blog i hope it will help you.
        http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c059d583-a551-2c10-e095-eb5d95e03747
    regards,
      ganesh
    Edited by: ganesh.nijampudi on Oct 25, 2011 12:00 PM

  • Unicode issue jdbc receiver adapter

    Hi guys,
    I'm facing an unicode issue while trying to put some data into a MS database.
    The sender system is a SAP ERP 6.0 system.
    When we are trying to transfer some text in polish or korean or something else, this textes are not transferred correctly.
    I already checked the SAP Note 831162 FAQ: XI 3.0 / PI 7.0 / PI 7.1 JDBC Adapter
    and used the url parameter sendStringParametersAsUnicode=true
    Furthermore I changed my mapping to get the sql statements, so that I add the attribute hasQuot="no"
    and a leading N in front of the data string as described in the Note and in some threads in SDN
    Unicode problem in JDBC receiver adapter
    JDBC adapter , problem in inserting Korean Charaters in MS SQL
    but nothing solved my problem.
    any ideas?
    Do all the languages have to be installed on the XI system?
    Kind regards
    Jochen

    Hi Sarvesh,
    thanks for helping.
    Unfortunately I´m not sure what I should exactly do.
    If I get you wright I have to test the mapping using the test functionality in message mapping (test tab).
    I did this already
    The result message looks like this
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:IDOC_CDB_IMPORT_insert xmlns:ns0="http://endress.com/xi/sbo/cdb">
       <ns0:StatementName1>
          <ns0:dbTableName action="insert">
             <ns0:table>CFG.DBO.IDOC_CDB_IMPORT</ns0:table>
             <ns0:access>
                <ns0:IDOC>CHRMAS</ns0:IDOC>
                <ns0:SEGMENT>E1CABTM</ns0:SEGMENT>
                <ns0:ATNAM></ns0:ATNAM>
                <ns0:SPRAS>PL</ns0:SPRAS>
                <ns0:ATBEZ hasQuot="no">N&apos;D?ugo?? ca?kowita Tl; L:&apos;</ns0:ATBEZ>
             </ns0:access>
          </ns0:dbTableName>
       </ns0:StatementName1>
    </ns0:IDOC_CDB_IMPORT_insert>
    How to proceed?
    copy this message to notepad or ultra edit and then doing what?
    please specify clearly.
    this message will be send to the jbdc adapter and this will insert it to database.
    <ns0:ATBEZ hasQuot="no">N&apos;D?ugo?? ca?kowita Tl; L:&apos;</ns0:ATBEZ>
    will end up in a table entry like D?ugo?? ca?kowita Tl; L:
    has anybody an idea how I will get the wright characters in database, when I test my UDF in eclipse, the variable during debugging has the correct text.
    When output this variable via system.ou.print(text); the same issue occurs, the special characters are shown as ?.
    I appreciate for your help, unfortunately my polish colleagues hustle a little bit.
    kind regards
    Jochen

  • PI 7.0 - jdbc receiver issue with MS SQL Server

    Hello Experts,
    I have a jdbc receiver scenario on PI 7.0 for just one table on MS SQL Server and I'm using the update_insert action.
    When the entry does not exist it is created normally and returns insert_count=1 and update_count=0.
    When the entry already exists, it's generated the statements for insert and for update (the 2 statements are visible on RWB) and returns insert_count=0 and update_count=0.
    Any error occurs and in the RWB the log shows the request was processed with success.
    I've already enabled the log for sql statements on the channel, but the statements are correct.
    I've reviewed also the <key> tag on the mapping and it's ok.
    Any suggestion to try fix this issue?
    Thank you very much.

    Can you please check in the database the format of the specified fields in the update statement. Sometime we can have situations that the insert works but the subsequent update fails. An example:
    Suppose key field1 value being passed from XI is  '1234' in characters but in db it is stored as '00001234'.
    Regards,
    Indranil

  • Broken pipe error in Sync Send JDBC Receiver:   Extremely Serious issue

    Hi forum,
    I have a serious error in a JDBC->XI--> JDBC scenario,
    Step1: I use a sender JDBC channel to select some distinct values from  a table say X, and update the same rows,
    Query SQL Statement: select distinct Branch from dbo.X where status = 0
    Update SQL statement: update dbo.X set Status = 2 where Status = 0
    Step 2: enter BPM
    Step 3: enter a loop
    Step 4:make a synchronous call to the same table X, to fetch some records,
    SQL query: select * from X where status = 0 and Branch = i; Update X set status = 9 where Branch = i
    Step 5: close loop,  this loop iterates for 5 or 6 times depending on i, which is no. of branches selected by the sender JDBC channel
    so all the calls are to the same table, same databsse(SQL Server)
    the problem is when this sync calls happens in the loop, it some times gives following error, which i se in RWB:
    <b>Error Unable to execute statement for table or stored procedure. 'X' (Structure 'STATEMENT_X') due to com.microsoft.sqlserver.jdbc.SQLServerException: An exception occurred during the DBComms.transmit operation. Exception:Broken pipe (errno:32). Context:(2217)</b>
    i have no way to trace the cause of the error, the database is perfect and the error logs in the SQL server shows no trace of any error,
    Note: It works sometimes
    i dont know whom to approach, pls help
    the issue is very very serious as its in production system,

    Hi Sudeep,
    SAP Note 846079 - XI 3.0 JDBC Receiver: # of Retries on SQL Error w/o Effect
    Please check the following SAP note also - 831162
    Some info which i found there and can be relevant in to your scenario.....
    Q: I am using a JDBC Receiver Adapter in conjunction with the  Lotus Domino Driver for JDBC perform an INSERT or UPDATE operation on a database. When sending a message to the receiver, the Adapter Monitoring shows the following error message:
    "java.sql.SQLException: [Lotus][Domino Driver for JDBC]Invalid cursor state"
    Is there a fix for this issue?
    A: To work around this JDBC driver problem, activate the Advanced Mode for the respective JDBC Receiver channel and configure the setting "Number of Retries of Database Transaction on SQL Error" to a value > 0. Additionally, make sure that the setting "Database Auto-Commit Enabled" is also active as the Lotus Domino Driver for JDBC does not support transactions.
    Apply note 846079 before configuring this scenario.
    Q: The TCP/IP connection to my database host is running over an unreliable network connection, i.e. the connection is sometimes interrupted. Consequently, I sporadically receive an SQLException regarding a closed connection in the system trace or audit log or the connection as well as the JDBC Adapter channel are hanging.
    How can I work around this connectivity issue?
    A: Enable the "Advanced Mode" for the respective JDBC Adapter channel and select the option "Disconnect from Database After Processing each Message".
    Note that this might put additional load on your DBMS due to the creation of a new database connection for each message.
    I dont have access to a database right now, so i am not able to check this.
    Also check the JDBC driver compatability as mentioned in the above note.
    Cheer's

  • Not able to insert the data in JDBC receiver

    hi Team,
    Please help me i am working on IDOC - JDBC interface i am not able to insert data into the table.
    error says that table doesn't exists, but if i check in the database the table exists..
    below is the error getting triggered.
    could not execute statement for table/stored proc."A_PORDER_REG"(structure " STATEMENT") due to
    java.sql.SQLException: ORA - 00942 table does not exist
    Thanks & Regards,
    Vishnu vardhan.

    Might be u have given table name is diffarent, table name must be match in table field of jdbc receiver structure and table name of data base tables.both places u must give the same table names . this is one reason another one u might be given jdbc structure is wrong. u must specify jdbc structure like this.
       STATEMENT
       TEST
        action(attribute) (action u specify as INSERT)
       TABLE( here  u give the table name )
    access ( below u write the fields)
    and one more is u check the receiver communication channel in that u check properly u have given jdbc drivers, connections , user name and pass word.
    check all those things definatly u wil find the error.

  • JDBC Receiver adapter ( INSERT/UPDATE with SELECT)

    Is it possible to have following kind of SQL Statement comming out JDBC Receiver Adatpter. If yes what would be the corresponding XML Document format for this.
    UPDATE suppliers 
    SET supplier_name = ( SELECT customers.name
    FROM customers
    WHERE customers.customer_id = suppliers.supplier_id)
    This condition also needs to be applied for Insert condition. Any pointer would be useful.
    Thanks,
    Samir

    Hi
    Refer this links,
    http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm
    Regards,
    Suryanaryana

  • JDBC receiver adapter: Insert of CLOB into Oracle DB

    Hi,
    I've got a short question:
    Is it possible to insert CLOB fields (larger than 4kB) into an Orcale database using the JDBC receiver adapter without using a stored procedure?
    We are on XI 3.0 SP20.
    I had someting in mind that this is only possible with a stored procedure but I am not sure on this.
    Thanks and Regards,
    Helmut

    HI,
    Is it possible to insert CLOB fields (larger than 4kB) into an Orcale database using the JDBC receiver adapter without using a stored procedure?
       yes, you can do it but it is not a best practise, but using Stored Procedure is .
    Regards,
    karna...

  • 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

  • How to Prevent the Duplicate record insertion by JDBC Receiver?

    HI Experts,
    I have File Sender to JDBC Receiver scenario.I am using SAP PI 7.1 system.
    Purpose of this Scenario is to read the data from specified file and INSERT or  UPDATE the same records in Oracle Database.
    Before inserting the data I want to check in the same table for prventing runtime error(Key fields Duplicatin).
    So if records with the same key fields are available in table then I want to UPDATE the same record instead of INSERT.
    Please Suggest me the poosbile way.
    Thanks & Regards
    Jagesh

    Hi Jagdesh,
    The JDBC receiver format has the following structure
    <root>
    <StatementName1>
    <dbTableName action=u201DUPDATEu201D | u201CUPDATE_INSERTu201D>
    <table>Table1</table>
    <access>
    <col1>val1</col1>
    <col2>val2new</col2>
    </access>
    <key>
    <col2>val2old</col2>
    <col4>val4</col4>
    </key>
    This structure creates a query in this way :
    UPDATE( OR UPDATE_INSERT) into Table1 set col1=val1 and col2 = val2new WHERE col2=val2old and col4=val4.
    The key field works like a Where clause. So for the receiver format when you specify the key, it checks the DB with that field as the where criteria. Hence for a UPDATE_INSERT query, when you specify the key field, it checks whether that value specified within the key field exists in the DB or not. Then it proceeds to execute the statement for only those values.
    Hence it makes sense to provide a primary key attribute in the key field of the JDBC receiver format.
    Regards,
    Kshitij

  • JDBC Receiver: Check INSERT Query.

    Hi Experts,
    I am working on IDOC To JDBC(INSERT) Scenario.
    Is there any possibility to check the INSERT Query that triggered by Receiver Adapter? If its possible please guide me how .
    Thanks,
    Vijay.

    Hi Vijay,
    Configure parameter logSQLStatement = true in advanced parameter of JDBC receiver channel. It will show the INSER query in audit log of message which you can see from message monitoring of RWB.
    Regards
    Sushil

  • Issue with JDBC receiver

    Hello All,
    We have SAP ECC (proxy sender) -> XPI 7.0 -> Oracle (jdbc receiver).
    We are querying data in some oracle tables. This is the error we see in communiation channel monitoring for JDBC receiver adapter:
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error when attempting to get processing resources: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: DriverManagerException: Cannot establish connection to URL 'jdbc:oracle:thin:@xxxxx.abc.def.com:1521:rdwT1': SQLException: ORA-28000: the account is locked
    But, we were told that login credentials (user/password) are working fine and account (user name give in the communication channel) is not locked.
    So, is there anything i need to check?
    In XI's SXMB_MONI, we see the following error:
    <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Exception in method process.</SAP:AdditionalText>
    Another question is, why is the error in communication channel monitoring not getting propogated to SXMB_MONI?
    Anything obvious missing here?
    Thanks,
    Chandra

    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error when attempting to get processing resources: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: DriverManagerException: Cannot establish connection to URL 'jdbc:oracle:thin:@xxxxx.abc.def.com:1521:rdwT1': SQLException: ORA-28000: the account is locked
    Please check the following..
    a) Test the above db connection string using TOAD or sQLplus and see how that works. The exception clearly shows account is locked. If you repeatedly use invalid credentials for three times using the jdbc channel there is a possibility that account gets locked.
    b) Also check the port, hostname and database name are right and valid one.  Also check with BASIS team whether one more time account is locked or not.
    Since you configured the receiver channel as JDBC and you will see this error log only at Java Stack.. that is in the communication channel monitoring.  This you wont see it in the Integration engine.
    Hope that helps.

Maybe you are looking for

  • Satellite M30-951 graphic card or video BIOS does not work properly

    On the BIOS and boot pages strange characters occur (screenshot www.audioberlin.com/M30-951_SCREEN.jpg). XP boots up but the elements displayed freeze and the display becomes black for a second. The system becomes slow and does not react any longer.

  • Nothing at all works in iCal on MacPro

    I have finally got the new mobileme calendar to sync relatively normally with iCal on my MacBook Pro and iPhone. This was a trial in itself but I have managed to work out the quirky behaviour of the new calendar. When I tried to add my MacPro to the

  • HELP! Web pages are not loading properly or not at all!

    This just started happening about a week or so ago and my laptop is only 3 months old. I typically use Safari and when this started happening I downloaded Google Chrome and it happens using that also. Either the browser can't find the specified web p

  • Sony a55 raw support

    Hi, Does anybody know hen I should expect iPhoto to support raw images from my new sony a55? seems rather odd as the NEX cameras has similar software and formats so i guess it must be a simple version number bump. Am I looking at a new version of iPh

  • Convert Qos commands from CATOS to IOS

    Hello, i've some problems converting some Qos commands from CATos to IOS can anybody help me? set qos drop-threshold 1q4t rx queue 1 50 60 80 100 set qos map 2q2t tx 1 1 cos 0 set qos map 1p1q4t rx 1 3 cos 4 set qos wrr 1p2q2t 50 255 set qos txq-rati