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>

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.

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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;

  • 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.

  • 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

  • My ipad3 has stopped receiving emails, have deleted and put account back on, still not receiving

    MMy ipad3 no longer receives email, have tried removing and reinstalling but no success

    TThank you for your response, I had reset Safari and in doing so the system had turned off SSL, once I turned this back on problem solved, but thank you again

  • Delete and Re-Insert a Row in the Same Statement

    Hello to all,
    I have to do a row Update of 2-3 columns, but due to my Triggers(delete and Insert) and unique index, I would like for same row one delete and one Insert of the columns modified,
    is it possibile in same(single) statement do this?
    That is,instead to do
    Update table1 set col3 = '6';
    I should do
          DELETE FROM  table1
          WHERE
    INSERT INTO table1
          SELECT col1,col2  ,'6'
         FROM table1
          WHERE -----thanks in advance
    Edited by: Rosario Vigilante on Mar 5, 2012 11:18 AM

    first of all thanks for your answer and your time,
    I already have 2 Triggers (OF delete and insert) that work well, when they fire they run a stored procedure that inserts rows into another table,
    ie, both triggers on the table 1 write rows on Table 2, more or less what happens in an audit table.
    Anyway thanks again

  • Mass delete and performances

    Hi,
    we use a few tables to log access to our various e-commerce sites.
    Now some of these tables are very large (20-50 millions row) so we decided to remove old data after having consolidated it.
    However deleting a large number of rows takes a long time (it took about 18 minutes to remove 2millions).
    We're removing all rows with primary key less than x (key is an integer).
    Does a method exists to mass delete with better performances (maybe disabling logging or ....) ?
    If not, can I send a delete statement that will run on background (i.e. disconnecting the client) possibly at a lower priority ?
    Rows are always inserted with primary key greater than x (it's a db sequence) so delete and insert never conflicts.
    Thank you

    Hi Andrea,
    I know that this might come a bit too late for your scenario, but how about this?
    For your logging table you could implement something like a poor-mans-partitioniong yourself.
    Instead of one big table, you create a table for each, say quarter yourself.
    You also create a synonym to he currently used "write-into-this" partition, so that your logging trigger doesn't have to be changed when the new partition should be used.
    On top of that you create a UNION view over all partitions.
    With that your requirements for logging everything should be fulfilled and (since you don't have to take care about updates) you can keep the active partition small and get rid of old data very fast (drop table/truncate table).
    If you go for the "truncate table" (which is pretty much the same as a "drop table" for MaxDB) then you can also think about having a fixed set of tables (Q1, Q2,... Q7, Q8) that you write to in a round-robin fashion. This would then be a kind of moving-window into your logging history.
    The only thing to take care of here is that you'll need to have a small time-slice in which you change the synonym every quarter.
    Just my two pence on this...
    regards,
    Lars

  • Setting priority of order of DELETE -vs- INSERT commands in Oracle database

    Hi,
    I have an .NET application which has a DELETE command (e.g. Delele from MyTable where id = 1) immediately followed by an INSERT command (e.g. INSERT INTO MyTable (id, field1, field2) values (1, 'x', 'y').
    We are not using transactions, so the commands are independent.
    MyTable has a unique constraint on the id column.
    On occasion, I am getting an error "ORA-00001 : unique constraint ... violated."
    I speculate that the INSERT command is being processed by the database before the DELETE command.
    Would you know if the priority of INSERT commands can be set higher to DELETE commands? How could I set this on my database (for testing purposes)?
    Thanks!

    One piece of the puzzle that I nelgected to mention...
    This DELETE/INSERT scenario is happening in an ASP.NET application going through Oracle's .NET driver (ODP.NET).
    The DELETE and INSERT are run with the autocommit feature of ODP.NET (I assume this translates into a separate transaction for each of these two statements).
    We have the "connection pooling" enabled (for the ODP.NET). Maybe because of the connection pooling, might ODP.NET be reversing the order of the DELETE and UPDATE commands?
    A problem I have is that I cannot see this problem occur on my server: the problem only occurs on the customer's server. He has reported several occurances of the problem.
    Do you think the Oracle session tracing will be of help if I cannot reproduce the problem (on my machine)?
    Thanks for you help so far!
    (clarification: The DELETE is run and "auto-committed", the immediately, the INSERT is run and "auto-committed")
    Edited by: user8267059 on Oct 15, 2008 6:00 AM

Maybe you are looking for

  • HT3819 home share setup question

    i just enabled home share for the first time (on my new iMac) but received the message that 4 of 5 devices are allocated (i am guessing that the list may include old iPods?) where can i review / edit the list of devices that are candidates for home s

  • HT1918 What I have to do to unblock my payment method?

    Hi, It seems there was a problem with my previous transaction (most probably insufficient funds - but i had deposited money on my card after the situation) and now I need to unblock my payment method. The same method is not accepted. If I enter an al

  • Photoshop does not accept my serial number

    I had Photoshop CS6 and Acrobat Pro X on my old Mac laptop. However, I now have a new laptop running Yosemite and neither program accepts my serial nos.

  • How to remove a requisition load from an infocube in a process chain?

    Hello everyone!! We have an internal BI in SAP APO and I have created a infocube to backup all data in the DP module. I have also created a process chain to schedule the load daily. Please, consider this: - I have to load every day a full load, I can

  • DG4ODBC: STRING DATA, RIGHT TRUNCATION ERROR WHILE ACCESSING VARCHAR(MAX) COLUMN

    Problem Summary DG4ODBC: STRING DATA, RIGHT TRUNCATION ERROR WHILE ACCESSING VARCHAR(MAX) COLUMN Driver Microsoft® ODBC Driver 11 for SQL Server® - RedHat Linux Problem Description When selecting a MS SQL VARCHAR (max) column over a ODBC Gateway data