JDBC Adapter: DELETE and INSERT in Mapping

Hi,
I have a JMS to JDBC interface. While this is straightforward enough, there is a requirement to clear the contents of the table before carrying out the insert
What I've tried is:
<MT_Message>
   <Statement>
        <TableClear>
             <action> .....attribute mapped to SQL_DML
             <access> ....element mapped to DELETE FROM table
        <TableInsert>
              <action> .....attribute mapped INSERT constant
              <table> ......element mapped to Table name
              <access> ...allthe fields in the table
The DELETE statement works and the Insert statement work but they won't work together. Is this possible at all? What other options are there in this case?

I went for two different Statement tags so the structure of the Message Type is:
<MT_Message>
  <StatementDelete>
         <TableClear>
             <action> ....attribute mapped to SQL_DML
             <access> ...element mapped to DELETE FROM Table
  <StatementInsert>
         <TableInsert>
              <action> ....attribute mapped to INSERT constant
              <table>  ....element mapped to table name
              <access> ...all the columns in my table

Similar Messages

  • Receiver JDBC: Error while doing the Deleting and Inserting new records

    Hi All,
              I am doing Idoc to JDBC scenario. In this I am collecting & bundling different type of Idocs and then sending to the JDBC receiver. My requirement is to delete the existing records in the database and insert the new records. I have configures as mentioned in the link
    Re: Combining DELETE and INSERT statements in JDBC receiver
    In the above link its shows for single mapping. In my scenario I am using multi mapping for collecting idocs in BPM. If I configured for normal mapping then it is working fine(Deleting existing records and Inserting new record). Whenever I am using multi mapping then I am getting following error in the receiver JDBC communication channel u201CError 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)u201D . Can you please tell me what might be the problem.
    Thanks & Regards,
    T.Purushotham

    Hi !
    check this out:
    JDBC - No 'action' attribute found in XML document - error
    JDBC receiver adapter: No 'action' attribute found in XML document
    It appears that the inbound payload (the one that is going from XI to the JDBC adapter) does not have the requiered tag to specify which SQL action to execute in the receiver system. Maybe the multimapping is not creating the desired output message format.
    Regards,
    Matias.

  • Delete and Insert logic depends on Flag JDBC Receiver

    Hi Experts,
    My Scenario is Proxy to JDBC. Present I am uisng 2 ststements for the receiver structure one for Delete and another for Insert. When I get a message from the source system, Database will be deleted and records will be inserted. Its working great.
    Now one more new FLAG filed is added in the source structure. My requirement is when i get '0'  value in the flag filed, I want to delete the database and need to insert records. and If value '1' comes in the FLAG filed, records needs to be inserted in the database table with out deleting old records.
    How can I achive this? thanks in Adv
    Vankadoath..

    HI Puneeth,
    I am using both the Delete and Insert statements in one DT.
    Flag is a filed name which is in the source DT .  if '0' comes in this Flag then tables needs to be deleted and records needs to be Insert. If value 1comes only records needs to be Inserted.
    how to do mapping with the key filed?
    This is my Input xml
    <?xml version="1.0" encoding="utf-8" ?>
    - <n0:RedMatchDB_EmployeesQualification_MT_OB xmlns:n0="ness.com:RedMatchDB_EmployeesQualifications" xmlns:prx="urn:sap.com:proxy:DV3:/1SAI/TAS8CFD98F20F1539B552C4:701:2009/02/10">
    - <EMP_QUALIFICATION>
      <Flag>0</Flag>
      <PERNR>7106413</PERNR>
      <QGROUP_ID>40001055</QGROUP_ID>
      <RATING>0005</RATING>
      </EMP_QUALIFICATION>
    - <EMP_QUALIFICATION>
      <Flag>1</Flag>
      <PERNR>7106414</PERNR>
      <QGROUP_ID>40001109</QGROUP_ID>
      <RATING>0004</RATING>
      </EMP_QUALIFICATION>
    - <EMP_QUALIFICATION>
      <Flag>1</Flag>
      <PERNR>7106415</PERNR>
      <QGROUP_ID>40001154</QGROUP_ID>
      <RATING>0004</RATING>
      </EMP_QUALIFICATION>
      </n0:RedMatchDB_EmployeesQualification_MT_OB>
    This is the output xml deleting is nat happening only records are Inserting.
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:RedMatchDB_EmployeesQualification_MT_IB xmlns:ns0="ness.com:RedMatchDB_EmployeesQualifications">
    - <statementDELETE>
    - <EMP_QUALIFICATION action="DELETE">
      <table>EMP_QUALIFICATION</table>
      <access />
      <key />
      </EMP_QUALIFICATION>
      </statementDELETE>
    - <statementINSERT>
    - <EMP_QUALIFICATION action="INSERT">
      <table>EMP_QUALIFICATION</table>
    - <access>
      <EmployeeID>7106413</EmployeeID>
      <QID>40001055</QID>
      <ProficiencyID>0005</ProficiencyID>
      </access>
      </EMP_QUALIFICATION>
      </statementINSERT>
    - <statementINSERT>
    - <EMP_QUALIFICATION action="INSERT">
      <table>EMP_QUALIFICATION</table>
    - <access>
      <EmployeeID>7106414</EmployeeID>
      <QID>40001109</QID>
      <ProficiencyID>0004</ProficiencyID>
      </access>
      </EMP_QUALIFICATION>
      </statementINSERT>
    - <statementINSERT>
    - <EMP_QUALIFICATION action="INSERT">
      <table>EMP_QUALIFICATION</table>
    - <access>
      <EmployeeID>7106415</EmployeeID>
      <QID>40001154</QID>
      <ProficiencyID>0004</ProficiencyID>
      </access>
      </EMP_QUALIFICATION>
      </statementINSERT>
      </ns0:RedMatchDB_EmployeesQualification_MT_IB>

  • JDBC Adapter - DELETE operation not working in receiver backend system

    Hi All,
    In my scenario ,I want  to delete entire records of the table from one backend system.
    I have created the inbound message and after mapping it is as below:
      <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:abc_delete xmlns:ns0="http://abc/xi/BACKEND/IB_IF_18/100">
    <STATEMENTNAME>
      <F12345 action="DELETE" />
      </STATEMENTNAME>
      </ns0:abc_delete>
    here F12345 is the table name.
    When I execute this scenario I get black and white flag in XI SXMB_MONI but in backend system (SQL Server) no records get deleted the table is as it is.

    Please have a look on this (same mentioned by Bhavesh)...
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm
    <b><b>  <StatementName3>
    <dbTableName action=”DELETE”>
    <key1>
    <col2>val2old</col2>
    <col4>val4</col4>     
    </key1>
    <key2>
    <col2>val2old2</col2>
    </key2>
    </dbTableName> 
      </StatementName3></b></b>
    &#9679;      action=DELETE
    Statements with this action cause existing table values to be deleted. One or more <key> elements formulate the condition for which table values are deleted. The names of <key> elements are arbitrary. Column values within a <key> element are combined with a logical AND; different <key> elements are combined with a logical OR.
    The corresponding SQL statement for StatementName3 in the example above is as follows:
    DELETE FROM dbTableName  WHERE ((col2=’val2old’ AND col4=’val4’) OR (col2=’val2old2’))
    The response document contains the following element:
    <delete_count>count</delete_count>
    If there is no <key> element, or if there is a <key> element but it is empty, then no condition is specified and the entire table is to be deleted. This may not be permitted by the configuration of the JDBC adapter for security reasons and will therefore result in an error during message processing and an appropriate error message.
    Thanks
    Farooq.

  • JDBC adapter , problem in inserting Korean Charaters in MS SQL

    Hi ,
    We are facing a problem when we are inserting "Koren Charaters" in DB of type MS SQL using JDBC adapter.
    What we tryed is:
    We found that there is a problem in Code Page Conversion.  We tried adding a Modules in Receiver Adapter of type JDBC.
    Processing Sequence:
    AF_Modules/XMLAnonymizer--Bean Local Enterprise Bean 1
    AF_Modules/TextCodepageConversionBean-Bean Local Enterprise Bean-- 2
    CallSapAdapter----
    Local Enterprise Bean     -- 0
    Module Configuration:
    1 anonymizer.encoding UTF-16
    2 Conversion.charset  UTF-16.
    But we are getting the error in CC as:
    "Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: ERROR occured parsing request:com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) feff, 3c, feff(:main:, row:2, col:6)(:main:, row=2, col=6) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) feff, 3c, feff(:main:, row:2, col:6)"
    also should I have to check any patches related to JDBC driver from MS SQL which supports korean Code Page?
    Any one who had face this problem pls give us inputs:
    Thanks
    Shankar

    Hi
    In the XML sent to the channel you will have to use a special quoting
    for any Unicode strings, which the JDBC Adapter will not produce on its
    own. Instead, you need to add an attribute 'hasQuot="no"' to those
    elements (most likely in the mapping where you produce the XML) and
    explicitly enclose the data in single quotes prefixed with the letter N.
    For clarity, one example:
    If your original "INSERT" operation looks like this:
    <StatementName2>
    <dbTableName action="INSERT">
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    </dbTableName>
    </StatementName2>
    and "col1" contains Unicode data, change the document as follows:
    <StatementName2>
    <dbTableName action="INSERT">
    <table>realDbTableName</table>
    <access>
    <col1 hasQuot="no">N'val1'</col1>
    <col2>val2</col2>
    </access>
    </dbTableName>
    </StatementName2>
    Regards
    Shankar

  • To delete and insert a new key figure in the cube

    Hi Experts...
                 How can I delete a key figure and insert a new key figure into a cube with data...? Should I be creating a new cube with the new key figure ?
    Thank you..
                Manohar....

    Hi
    Are you using Bi2004s
    yes you can delete,add,replace a key figure
    have a look at this blog for step by step procedure
    /people/mallikarjuna.reddy7/blog/2007/02/06/remodeling-in-nw-bi-2004s
    hope this helps

  • JDBC Adapter - DELETE like statement

    Hi all,
    I want to DELETE some data from SQL SERVER.
    My SQL statement is:
    DELETE FROM dbTableName  WHERE col1 = u2019val1u2019 AND
                                                              col2 LIKE u2019*u2019 AND
                                                              col3 = 'val3'
    My XML message is:
    <statement1>
       <LINES  action="DELETE">
          <table>dbTableName</table>
          <key>
            <col1>val1</col1>
            <col2 compareOperation="LIKE ">*</col12>
           <col3>val3</col3>
         </key>
      </LINES>
    </statement1>
    I don't receive any error, but nothing is deleted from dbTableName.
    Waiting for some suggestions.
    Regards,
    Natalia.

    Hi,
    I have a trigger in SQL SERVER on this table:
    add update/delete trigger to dbTableName table */
    CREATE TRIGGER  tr_DBTABLENAME UPDATEDELETE ON DBTABLENAME
    instead of update, delete
    AS
    UPDATE DBTABLENAME
       SET
         DBTABLENAME .DMLoperation=1,
         DBTABLENAME .DMLTimeStamp = GETDATE()
    FROM DBTABLENAME  JOIN Deleted ON DBTABLENAME .Val1= Deleted.Val1AND DBTABLENAME .VAL2 = Deleted.VAL2 AND DBTABLENAME .VAL3 = Deleted.VAL3
    INSERT INTO DBTABLENAME
       SELECT Inserted.*
          FROM Inserted LEFT JOIN DBTABLENAME  ON
               DBTABLENAME .Val1= Inserted.Val1AND DBTABLENAME .VAL2 = Inserted.VAL2 AND DBTABLENAME .VAL3 = Inserted.VAL3
       WHERE DBTABLENAME .DMLoperation is null
    UPDATE DBTABLENAME
       SET
         DBTABLENAME .Val1= Inserted.Split_Src, DBTABLENAME .VAL2 = Inserted.VAL2, DBTABLENAME .VAL3 = Inserted.VAL3, DBTABLENAME .LAST_FILED = Inserted.LAST_FILED, DBTABLENAME .DMLTimeStamp = GETDATE(), DBTABLENAME .DMLoperation = 2
    FROM DBTABLENAME  INNER JOIN Inserted ON DBTABLENAME .Val1= Inserted.Val1AND DBTABLENAME .VAL2 = Inserted.VAL2 AND DBTABLENAME .VAL3 = Inserted.VAL3
    May be this is the reason.
    Thanks,
    Natalia.

  • Delete and insert same Object in one transaction?

    Hi all,
    Can be possible in one transaction delete and then insert same object into the database?
    If I want change PK in some record in DB, then I must delete the Object and then insert new Object (row). And this I want realize in one transaction - Unit of Work.
    Is this possible?
    Thx advance,
    best regards,
    KLD
    P.S. Sry for my English

    Generally not always a good idea, but may be possible. If you are using JPA, you should be able to do a flush() after deleting the object, then re-persist the new one.
    For the UnitOfWork API, writeChanges() is the same as flush, but it only allowed to be called once, so you may need to use the RepeatableWriteUnitOfWork, or performDeletesFirst option.
    Or just use two separate units of work.
    James : http://www.eclipselink.org

  • Deleting and re-installing maps

    Hello
    I wish to uninstall maps and then re-install it, because I seem not to have all the options that should be there. I think the system went crazy after installing the beta version of maps.
    I am missing an option from the navigation menu, re-routing. I can't ask for another route for the navigation. It gives me a route, but should I choose another route to get where I want to go, the selection button has the option "another route", but the icon is missing and I can't select that. Thus I can't have another option for routing.
    Please, can someone help me.

    Right, after speaking to Nokia support the issue is now resolved.
    How to fix.
    Prepare Phone.
    1) Before commencing I would suggest that you delete the cities folder from your phone (as others have suggested this to be an issue). This can be done via the USB connection or using the File mgr. (found under tools).
    Update maps software.
    2) Goto, europe.nokia.com/maps
    3) On left hand side choose the phone (N95) and download the latest version of Nokia maps.
    4) Connect phone and install nokia maps. (Requires PC Nokia Suite installed)
    5) Follow instructions on phone to complete installation.
    Test software.
    6) Run Nokia Maps.
    7) Choose extra services, add navigation and follow the screen prompts to active or re-activate navigation.
    NOTE: When I attempted this the first time it still crashed the maps application. 2nd time through there were no issues and I re-activated navigation.
    8) Test navigation.
    This should resolve the issue, latest map data can now be downloaded using nokia maps.
    Update maps
    9) Download v1.3 of map loader
    10) Download and install latest map data.

  • How to include change delete and insert options in alv grid display

    Hi,
    As per my requirement I need to display my output in grid.
    When the user makes any changes to any field of the alv it should get reflected in the tatabase table.
    Similarly according to the requirement if user enters a new coloumn to the alv or deletes one or more rows of the alv,same should be reflected in the databse table.
    I know there are many methods in object oriented.
    But its little bit tough for me to implement..
    Please suggest how to code for it without oo concepts.
    Thanks ,
    Smriti

    Hi,
    use FM with Edit functionality enabled for all fields and
    Create one pf-status with some buttons
    if user presses the button the alv output table should be saved and same table can be used to insert /modify /delete the dbtable.
    and check this link
    [alv list|alv list]
    Regards,
    Nandha

  • Bug or Feature? Array Custom Contextual Menu Destroys "Delete" and "Insert" Element!

    Step to Reproduce:
    - Create an Array (doesn't matter of what type).
    - Ctrl-M (to switch to Run Mode)
    - Notice that:
           - when you Right-Click on the Array borders, you have access to an "Empty Array" menu item among other things
           - when you Right-Click in an Array element, you have access to an "Insert Element Before" and a "Delete Element" menu item among other things
    - Now switch back to Edit Mode and modify the contextual menu in the following way:
            - Advanced>>Run-Time Shortcut Menu>>Edit...
            - Edit>>Copy Entire Menu
            - Switch to "Custom" menu (instead of "Default"): the menu disappears and is replaced by a single ??? item
            - Edit>>Paste: The default menu reappears with the ??? on top
            - Create you favorite custom menu item by editing the ??? item (say: Do Nothing)
    - Save the menu with the control and switch to Run Mode (Ctrl-M).
    - Now try the first 3 steps above: wherever you right-click, you have access to the Custom Menu, but the Array Element contextual menu is GONE.
    In other words, you cannot (it seems) define a custom contextual menu for an array without destroying the default contextual menu for its elements.
    Therefore, if you want to preserve the ability to Insert and Delete Elements in an array, you have to add these two items to the Array contextual menu and juggle with the position of the right-click to figure out whether or not to display them...

    Well, I created in LabVIEW 2012 such a control and added part of the default menu in the way you described with copy-paste as a submenu to an Edit entry in my custom menu and it did not disappear:
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Adaptive RFC and multiple systems; Mapping JCO_DESTINATIONS by code?

    Hi,
    I have just learned <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/82/76a2406546ba15e10000000a1550b0/frameset.htm">here</a> that I can access several R/3 systems with the adaptive RFC model by using URL parameters like:
    http://<hostname>:<port>/webdynpro/dispatcher/local/ESSProject/ESSApp?
    <b>sap-wd-arfc-useSys=WD_MODELDATA_DEST:ABC&
    sap-wd-arfc-useSys=WD_RFC_METADATA_DEST:ABC</b>
    The parameters are a mapping of the original JCO_DESTINATION (WD_MODELDATA_DEST) called by the WebDynpro application to the target system which instead should be called (WD_MODELDATA_DESTABC).
    Does someone know wheather this mapping can be done by java coding? For example before the execute method will be called.
    Best regards,
    Marcus

    Hi,
    This for If you send destination params are different u sent it thru URL param only.
    For that u need generate URL by using the application .
    For that purpose u need to create two applications u can call the first application in second application u can create URL and send Destination params with URL only.
    Other wise u can create the par file that would be configured in portal and thru worksets u can pass the params like u mention the destinations.
    Or at the time generationg URLS only u can add the destination names.
    Thanks,
    Lohi.

  • Statement AUDIT SELECT TABLE also audits update, delete and inserts

    Hi,
    Database Oracle 11g.
    After turning on AUDIT with these 2 statements:
    SQL> ALTER SYSTEM SET audit_trail = "DB_EXTENDED" SCOPE=SPFILE;
    SQL> AUDIT SELECT TABLE BY ACCESS;
    then insert, update and delete statements are recorded in sys.aud$ as well as select statements.
    My expectation was to see only select statements in sys.aud$.
    Please clarify :-)
    Best regards
    Erik

    it should not record other action apart from select,can you crosscheck audit configuration by
    select * from DBA_OBJ_AUDIT_OPTS;
    SELECT * FROM ALL_DEF_AUDIT_OPTS;

  • Approx how much time should JDBC adapter take to insert 1.5 million record?

    Hi All,
              What is the optimum time for inserting 1.5 million records to Oracle Staging Table? My scenario ECC to Oracle is taking 3 hours.
    With your previous experience, what do you think about this. Is there a scope of improvement?
    We have a simple insert through JDBC datatype. i.e Action = INSERT.
    Kindly Advice.
    Regards,
    XIer
    Edited by: XIer on Mar 27, 2008 9:20 AM
    Edited by: XIer on Mar 27, 2008 10:02 AM

    Hi,
    >What do you think is the optimum time with your experience...
    We had Similar Situation  after adding Application Server  the time was reduced to 1 hour.  Now  how many App server are available in your XI system ?
    Regards
    Sangeetha

  • To use same storage area.(deletion and insertion)

    suppose a table has 5 records i used truncate command.then i want to insert a record which might be used same storage area .what steps to be followed to use same storage area.

    If u use tools like TOAD, while truncating a table it will ask u whether to reuse or drop the storage.

Maybe you are looking for

  • Network and Sharing Centre problems (again)

    I seem to be tearing my hair out once again with the Network List Service. Several months back the Network and Sharing centre stopped displaying or reporting the active networks, although I was connected with internet access. A consequence was most o

  • Query name from work book id

    Hi Guys, Iam in bex browser, iam seeing a report here how to find a query name using the work book id. Thanks, V.Singh.

  • Maintaining catalog data when moving files

    I want to migrate a portion of my cataloged raw files to a differnet hard drive on the same computer while maintaining the integrity of the location data, my edits and other catalog information. but can't locate Help or tutorial topic that covers thi

  • Spark.core.ContentCache with AIR 3.7 on iOS not working

    I've been trying to migrate a large Flex 4.6 mobile project from AIR 3.5 to AIR 3.7 for several days with no luck. The issue that kills me is Error #3747: Multiple application domains are not supported on this operating system. This happens only on i

  • Are there shortcuts in Media Encoder CS4

    Hi, I know of Ctrl+D that duplicates an export in AME. Are there other shortcuts to: - change the Format - change the Preset I see no shortcut settings in the preferences... Thanks