How can i Delete the data from three tables at a time  using same key.

I am New to Oracle ADF, I have a Requirement Like these, I have three tables like Employee,Salaries,Teams all of these are having one common EmpNo as common attribute, I have Search form these will return the all the employees related to that search query, when i click on Delete button the particular employe Data should delete from all the three tables based on the EmpNo.
Any Help is appreciable..

1) The easiest way is to mark the foreign key constraints from SALARIES to EMPLOYEES and from TEAMS to EMPLOYEES as ON DELETE CASCADE. The DB server will then delete the necessary rows whenever you delete an employee row.
2) Another way is to implement a Before-Delete-Row DB trigger on the EMPLOYEES table where you can delete the related rows in the other tables (have in mind, that if you have foreign keys you may get a Mutating Table Exception, so this approach might be not very good).
3) An ADF way is to implement a custom EntityImpl class for the Employee entity and to override the remove() method where you can lookup the related TeamMember and Salary entities (through EntityAssoc accessors) and invoke their remove() methods too.
4) Another ADF way is to implement a custom EntityImpl class for the Employee entity and to override the doDML() method where you can delete the necessary rows in SALARIES and TEAMS tables through JDBC calls whenever a DELETE operation is being performed on the underlying Employee entity.
Dimitar

Similar Messages

  • How can i convert the data from mutiple-table to the other database(MSSQL)?

    Dears,
    How can i convert the data from mutiple-table to the other database such as MS-SQL?
    I have a third party system based on MS-SQL 2000.
    Now we want to make a integration between SAP R/3(Oracle) and SQL server.
    When my user releases the purchase order in R/3, the application we coded will convert the releated data to the temp database on the SQL server.
    But i don't know which tools will help me reach the purpose.  BAPI, LSMW, IDoc... ???
    Would anybody tell me which way is better and how to do?
    Thanks a lot!
    Kevin Wang

    Hello Kevin,
    The question to use which method depend on your detail requirements. If you use BAPI, you need to find which Bapi can provide the data you want. Bapi normally use as a function called by external system. So you need to develop an external program like VB/Java to call this Bapi and move it to SQL. LSMW is use when you want to upload data from an external system to SAP. So it does not serve your requirement. Idoc can be use to export data to an external system. Again like Bapi, you need to find what Idoc can provide the data you want. However, it does not any programming from the external system. If I were you, based on your requirements, I think writing an Abap program that read the data you want and download it to NT/SQL server will be faster and easier.

  • How can we delete the invoice from hub table

    Document No 90048130
    Invoice No 9000112482
    Amount 31,009.17
    Currency EURO
    here the document having billing documents . how can i delete the invoice document . here billing documents we can cancell it using the t code vf11 .but how can we delete the invoice .can u please help on this .
    Thanks in advace .
    Raj

    Here is the SAP help on this topic.  I guess that answers your question.
    When you cancel a billing document, you are actually creating a cancellation document. The cancellation document copies data from the billing document and transfers an offsetting entry to the accounting department.
    Features
    The cancellation document causes the reference document for the billing document (e.g. the delivery) to be reopened so that a correct billing document can be created.
    You can also cancel individual items. In the billing document, goto: Edit - Cancel item This function is not possible for:
    rebate agreements
    transactions involving credit cards
    documents that have not yet been forwarded to Financial Accounting

  • How Can i get the data From A Table that use DefaultTableModel

    Hi and sorry for my bad english. The problem that i have is that i used this code to fill a table. Now i want when i select a row and click in a button , get the value of that row that i select so then i can update or delete that data in my dataBasesServer.
    private void consulta(){
              Connection c = ConectarSQL.conexionSQL();
              try {
                   Statement s = c.createStatement();
                   ResultSet ar = s.executeQuery("Select Apellido, Nombre FROM Personas");
                   DefaultTableModel modelo = new DefaultTableModel();
                   this.Tabla.setModel(modelo);
                   modelo.addColumn("Apellido");
                   modelo.addColumn("Nombre");
                   while (ar.next()) {
                      Object [] fila = new Object[2];
                      for (int i=0;i<2;i++)
                         fila[i] = ar.getObject(i+1);
                      modelo.addRow(fila);
              } catch (SQLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }

    Dont worry kevinaworkman, the thing is that a read it and is really usefull, but i was looking other kind of solution. But i welcome your answer and interested to solve my problem.
    I find the answer.
    To retrive the data i have to use the following instruction:
    Tabla.getValueAt(Tabla.getSelectedColumn(),Tabla.getSelectedRow);

  • Hi how can i fetch the data from tree table

    Hi i am designing a UI in which i am creating a java tree table as on sun java site http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html now i have to fetch the perticular column value on the mouse click.I have implemented mouse listener and on mouse clicked event I tried :
    Object obj=tableInputOutputEntities.getValueAt(tableInputOutputEntities.getSelectedRow(),tableInputOutputEntities.getSelectedColumn());
    as we usually do in case on JTable but it is also throwing null exception. Again after going through forum i found some code to get the current row and current column selected values and tried with getValueAt(int,int) method but still it is throwing nulll pointer exception. Please help me out.
                         public void mouseClicked(MouseEvent e)
              Point p = e.getPoint();
              int row = treeTable.rowAtPoint(p);
              int column = treeTable.columnAtPoint(p);
              Object obj=treeTable.getValueAt(row,column);
              System.out.println("Object value: "+obj.toString());               
                                }Regards
    Naxy

    Hello Kevin,
    The question to use which method depend on your detail requirements. If you use BAPI, you need to find which Bapi can provide the data you want. Bapi normally use as a function called by external system. So you need to develop an external program like VB/Java to call this Bapi and move it to SQL. LSMW is use when you want to upload data from an external system to SAP. So it does not serve your requirement. Idoc can be use to export data to an external system. Again like Bapi, you need to find what Idoc can provide the data you want. However, it does not any programming from the external system. If I were you, based on your requirements, I think writing an Abap program that read the data you want and download it to NT/SQL server will be faster and easier.

  • How to delete the data from partition table

    Hi all,
    Am very new to partition concepts in oracle..
    here my question is how to delete the data from partition table.
    is the below query will work ?
    delete from table1 partition (P_2008_1212)
    we have define range partition ...
    or help me how to delete the data from partition table.
    Thanks
    Sree

    874823 wrote:
    delete from table1 partition (P_2008_1212)This approach is wrong - as Andre pointed, this is not how partition tables should be used.
    Oracle supports different structures for data and indexes. A table can be a hash table or index organised table. It can have B+tree index. It can have bitmap indexes. It can be partitioned. Etc.
    How the table implements its structure is a physical design consideration.
    Application code should only deal with the logical data structure. How that data structure is physically implemented has no bearing on application. Does your application need to know what the indexes are and the names of the indexes,in order to use a table? Obviously not. So why then does your application need to know that the table is partitioned?
    When your application code starts referring directly to physical partitions, it needs to know HOW the table is partitioned. It needs to know WHAT partitions to use. It needs to know the names of the partitions. Etc.
    And why? All this means is increased complexity in application code as this code now needs to know and understand the physical data structure. This app code is now more complex, has more moving parts, will have more bugs, and will be more complex to maintain.
    Oracle can take an app SQL and it can determine (based on the predicates of the SQL), which partitions to use and not use for executing that SQL. All done totally transparently. The app does not need to know that the table is even partitioned.
    This is a crucial concept to understand and get right.

  • How can we delete the data in e-fact table.

    how can we delete the data in e-fact table.

    hii,
    You cannot delete the request individually but you can one of the following:
    1. Do a selective deletion from the cube. RSA1 -> Cube -> Contents -> selective deletion.
    2. Delete all the data in the cube and then reconstruct only the required request ids. This would work only if you have the PSA available for all the requests.
    3. Reverse posting is another possibility.
    hope it helps,
    partha

  • I have Time Machine that I used to back up my old computer. It was running snow leopard. My MacBook died, so I got a new one which is running Lion.  how can I restore the data from the time capsule to my new Mac?

    I have Time Machine that I used to back up my old computer. It was running snow leopard. My MacBook died, so I got a new one which is running Lion.  how can I restore the data from the time capsule to my new Mac?

    In technical support, sometimes you have to make educated guesses. I'm sorry that you were offended.
    iTunes does prompt when it is going to erase a device, and the message is clear.
    She said in her message that she was able to successfully sync the old ipad. This indicated to me that itunes wiping the data was not an issue, because either it had been setup at the apple store (in which case it doesn't actually wipe the ipad despite saying it will*) (*based on a single case I saw), or because the itunes media folder was migrated.
    Furthermore, my solution was to tell her how to backup her ipad (by either doing it manually, or as a last resort, by deleting the corrupt backup -- that she couldn't access anyway.)
    I got that last part of the instructions from the "Taking Control of your iphone" book which I found samples of when I did a google search for "corrupted backup itunes".
    She marked this as a solution, so it worked for her.

  • How shall I delete the data from R/3 setup tables

    Hi Experts,
    How shall I delete the data from R/3 setup tables
    Regards
    Sailekha

    Hi Sailekha , to delete the set up table in r/3 either u can go to tcode LBWG as already mentioned or u can also delete the same from tcode SBIW
    Settings for Application-Specific DataSources (PI)  -
    Logistics -
    Managing Extract Structures -
    Initialization -
    Delete the Contents of the Setup Tables .
    Just click the clock there then u hace toi juct give the application component name like for Inventory 3 , then execute it , it will delete the set up table for inventory ..
    Regards..

  • How Can we get the data from Non-SAP to SAP in WebDynpro

    Hi,
    I hope u understand my query, How can we get the data from Non-SAP to SAP thru WebDynpro Programming.
    Help out with the steps for getting the data or procedure.
    Regards,
    Mutyapu

    You can expose the APIs in the Non-SAP backend as Web Services, and consume them in SAP by creating an Enterprise Proxy. Then these can be called just like normal class methods from Web Dynpro.
    Regards,
    Nithya

  • How can we export the data from OAF Page to Excel instead of .csv or .txt

    Hello,
    How can we export the data from OAF Page to Excel instead of .csv or .txt
    When i click on the export button it is exporting to txt file, But i need to export the data into Excel by default
    Please help me
    Thanks in advance
    Thanks,
    Raju
    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju
    Edited by: 1006649 on May 21, 2013 10:55 AM

    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju

  • How can i save the data from the Oracle database to my local directory

    How can i save the data from the Oracle database to my local directory instead Of saving the data file to the Directory created on the Oracle Server ?
    I require to design the Procedure which will pull the data from various tables and needs to store the data in the Client's local directory.

    Since SQL*PLUS runs on the client, you can use SQL*PLUS to spool data to your local drive.
    You could also use the database to write a a specified drive where all users have access to (mapped network drive, e.g.). I wouldn't recommend doing it that way, but it is sometimes useful when the files are created in some nightly batch run.

  • How can I extract the data from Xstring .

    Hi Gurus ,
    How can I extract the data from a XSTRING  .
    I have to get the data which is filled in the survey form the data is getting saved in form of xstring .
    Someone told me that there is a standard FM for that . but I am not able to find .
    Please reply with the FM in case some one knows about it .
    Thanks in advance .

    The following code works as of 7.0 (in any SAP system):
    FORM XSTRING_TO_STRING USING input TYPE xstring CHANGING output TYPE string.
    TYPES : BEGIN OF ty_struc,
              line TYPE c LENGTH 100,
            END OF ty_struc.
    DATA lt_char TYPE TABLE OF ty_struc.
    DATA length TYPE i.
    length = xstrlen( input ) / cl_abap_char_utilities=>charsize.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer                = input
      tables
        binary_tab            = lt_char.
    CONCATENATE LINES OF lt_char INTO output RESPECTING BLANKS.
    output = output(length).
    ENDFORM.
    Edited by: Sandra Rossi on Mar 30, 2010 12:24 AM

  • How can i store the data from the list to MS-Access?

    Hi all,
    We all know that from alv it is possible to export data to Ms-excel or word or text file. Can anyone tell me how can i store the data from alv or reports to Ms-Access?
    Thanks in Advance,
    Abhijit

    Hi,
    If you want that without code, i suppose there is a option in MS-Access to import data from Excel, so you have to first export to excel and then import to Access.
    If you want to code it yourself then have a look at FM TABLE_EXPORT_TO_MSACCESS, as said in Exporting Data from R/3 to MS ACCESS
    You can also see the search results in SCN for [export data to MS-Access (45 Results)|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=exportdatato+MS-Access&cat=sdn_all].
    Regards
    Karthik D

  • I removed my SSD card from my broken macbook, how can I transfer the data from it to another computer?

    I removed my SSD card from my broken macbook, how can I transfer the data from it to another computer?  I have an iMac now or a PC. 

    You can put it into any notebook SATA enclosure such as Build your own External/Add your own drive up to 1.5TB! OWC Express USB 2.0 Express Kits From $18.79 USB 3.0 Express Kits From $21.99.

Maybe you are looking for

  • HFM Data Form in Smart View - Improper Suppression

    We have several data forms that are opened by a group of controllers every month to load forecast information to HFM. This data form is opened by all of these users in Excel and submitted back to HFM via Smart View. We have instructed all of the user

  • Copying iPhoto Library to new MacBook Pro

    I have recently bought a new MacBook Pro primarily to use when travelling. I also have a iMac which will continue to be my main mac. I naively thought that by using Migration Assistant I'd be able to copy/transfer all the stuff I have on my iMac (iTu

  • How can I save global settings? (already tried everything...)

    Hi everyone, I have a PC with Windows 7 - 64 bits and I am using the latest version of Flash Player (14.0.0.145 right?) on Mozilla Firefox. I have a very frustrating bug with adobe for ages, maybe someone know how to fix this... Basically, when I try

  • Narration won't create file in PE7

    I am using Premier Elements 7 with Vista SP2. I have had several problems with the program crashing. I have almost completed adding narration and a soundtrack to my project. All of a sudden, the narration does not create a file and nothing goes to th

  • Join 2 tables with a reference table

    I have two large tables that I am trying to join together by two columns. Below are the tables with two samples in each table, the reference table and also the final result that i want. Can anyone help me and any pointers. Thank you so much.  Join on