How to Restore deleted records in other table in oracle database 10g...

Hi All,
i want to restore deleted records of a particular table in other table
suppose:
i perform a query
delete from emp
where deptno =30;
now i wont to restore deptno=30 records in other table, let say in emp1 table
can any one let me know how to do it?
Thanks..

This is what flashback query is for:
orclz> conn scott/tiger
Connected.
orclz> select count(*) from emp;
  COUNT(*)
        14
orclz> delete from emp where deptno=30;
6 rows deleted.
orclz> commit;
Commit complete.
orclz> create table deleted30 as select * from emp as of timestamp(systimestamp - 5/1440) where deptno=30;
Table created.
orclz> select count(*) from deleted30;
  COUNT(*)
         6
orclz>

Similar Messages

  • How to check deleted record in a table

    Hi to all,
    any one can do need ful to me for how to check last deleted record in a table.

    Since you are on 8i,
    AUDIT DELETE TABLE AUDIT
    and Using LogMiner
    are your best chance to find out last deleted records.
    If you are on 9i and later, you can also use flashback query to join current table with table image few minutes back to find out the difference.

  • Any way to restore deleted record from VBAP table.

    Hi Guru,
    Is their any way to restore deleted record from vabp.
    Back is taken but , All quality server back is taken, any way to restore only
    deleted VBAP data from all Back.
    Regards
    Durgesh

    Hi Sahu ji,
    you will not be able to get those records.
    Check this : If this issue is in Development than no need to worry.
    If in quality and production , then usually a copy of the system is there , and this can help you.
    Also , check is there any report that exports this data in some other form for backup.
    Hope it help you.

  • I don't know how I can install APEX 3.1.2 in Oracle Database 10g(10.2.1)

    Hello.
    I have a hard time the install of the APEX 3.1.2. My server is WindowsXP and Oracle Database is 10g.
    How can I install APEX? I have seen many many many manual involved in install APEX but I can't understood that.
    Please teach me how the install of APEX easily.
    Thank you.
    Edited by: MyeongJin on 2009. 1. 27 오후 11:46
    Edited by: MyeongJin on 2009. 1. 27 오후 11:46

    Thanks for your reply, Roel!
    I always deeply thanks for your help.
    After reading your reply, I found out I missed install HTTP Server.
    So I have installed HTTP Server in companion CD and I made the adjustment like marvel.conf and httpd.conf.
    But I can't solve my problem yet.
    I entered the address - http://127.0.0.1:7777/pls/apex/apex_admin - in the web browser, then
    I saw such a like under the message.
    +++Service Temporarily Unavailable+++
    +++The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.+++
    +++--------------------------------------------------------------------------------+++
    +++Oracle-Application-Server-10g/10.1.2.0.0 Oracle-HTTP-Server Server at MJLEE-EXEM.ex-em.com Port 7777+++
    Please help me one more time.
    I'm waiting for your help. Thanks.

  • Please explain how to restore delete, send and other basic icons to the toolbar.

    These are nowhere to be found, incredibly. I will switch to another program if I can cannot access simple tools.

    http://chrisramsden.vfast.co.uk/13_Menus_in_Thunderbird.html

  • How to insert a record in ROOSPRMSC table? (accidentally deleted)

    Calling an InfoPackage in BW causes short dump, while fixing the short dump issue, accidentally
    deleted the "ROOSPRMSC" table entries.
    Could you tell me how to insert a record in "ROOSPRMSC" table???

    Hi Senthil,
    Regards,
    Phani Raj Kallur
    Message was edited by: Phani Raj Kallur

  • How do you delete records from table with data in a select option

    how do you delete records from table with relevant to data in a select option..how to write coding

    Hi,
    Try
    if not s_select_option [ ] is initial.
    delete * from table
    where field in s_select_option.
    endif.
    commit work.
    Be careful though. If select option is emty, you will delete the entire table.
    Regards,
    Arek

  • How can i fetch records from 3 tables in a single query  without using join

    Hi.
    Can any body please tell me <b>How can i fetch records from 3 tables with a single query  without using joins</b>
    Thanx
    prabhudutta

    Hi Prabgudutta,
    We can fetch the data by using the views concept.
    Go throuth this info we can know the how to create view and same like database table only we can fetch the data.
    Views conatin the data at runtime only.
    Four different view types are supported. These differ in the
    way in which the view is implemented and in the methods
    permitted for accessing the view data.
    Database views are implemented with an equivalent view on
    the database.
    Projection views are used to hide fields of a table (only
    projection).
    Help views can be used as selection method in search helps.
    Maintenance views permit you to maintain the data
    distributed
    on several tables for one application object at one time.
    step by step creation of Maintenance view:
    With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
    It can be set in transaction SE11 - Tools - Table maintenance generator.
    Table maintanance Generator is used to manually input values using transaction sm30
    follow below steps
    1) go to se11 check table maintanance check box under attributes tab
    2) utilities-table maintanance Generator-> create function group and assign it under
    function group input box. Also assign authorization group default &NC& .
    3) select standard recording routine radio in table table mainitainence generator to move table
    contents to quality and production by assigning it to request.
    4) select maintaience type as single step.
    5) maintainence screen as system generated numbers this dialog box appears when you click on create button
    6) save and activate table
    One step, two step in Table Maintenance Generator
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
    SM30 is used for table maintenance(addition or deletion of records),
    For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
    Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..
    It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..
    In the SE11 delivery and maintenance tab, keep the maintenance allowed..
    Then come to the SM30 and then enter the table name and press maintain..,
    Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
    Then create,,,
    Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
    We use SM30 transaction for entering values into any DB table.
    First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
    Then it will create a View.
    After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
    Hope this resolves your query.
    Reward all the helpful answers.
    Rgds,
    P.Naganjana Reddy

  • Deleting Records from Referential Tables

    Hi,
    Can anyone help me in deleting records from tables in a hierarcial manner. For e.g C refers B and B refers A. I need to delete data from all three tables related to a where clause in A.I tried using User_constraints and User_cons_columns views. But i am not able to find a hierarchial delete statement.
    Venkatesh

    Did you look into the option of specifying ON DELETE CASCADE for your foreign key constraints. That way, if you delete a
    row from the master table Oracle will automatically go and delete the child rows. Take a look at the following script.
    Here, when I delete a row from table A for NUM = 1 the child rows from table B (WHERE num = 1) are automatically deleted.
    drop table b
    drop table a
    create table a (num number, name varchar2(40))
    create table b (num number, name varchar2(40))
    alter table a add constraint pk_a primary key(num)
    alter table b add constraint fk_b_num foreign key (num) references a(num) on delete cascade
    insert into a values (1, 'Test#1')
    insert into a values (2, 'Test#2')
    insert into b values (1, 'Referes#1')
    insert into b values (2, 'Referes#2')
    select * from a
    select * from b
    delete from a where num = 1
    select * from a
    select * from b
    Sridhar,
    Thanks a lot for your help.My exact need was to delete records in 50 tables starting with the key table for a specific condition in the key table.
    Assume table A has 100 records,B 200 records,C 150 records,D 400 records, etc
    When i want to delete some records in table A, i will not be able to do that as child records exists in table B and this structure will carry on till that last table in my application. How do i delete those specific records
    Venkatesh

  • How to restore deleted playlists

    how to restore deleted playlists...my "trash" apparently use the playlist name

    Immediately use the command Edit > Undo Delete.

  • Deleting records in a table based a collection

    I wanna delete records in a table which do not match the records in the collection.
    Since the collection is a pl/sql collection I cannot do it like
    v_t v_type;
    DELETE FROM sample WHERE flex_name NOT IN (SELECT * FROM TABLE(v_type(SELECT * FROM v_t)));
    is there any other alternative to do the same ?

    Hi
    please use this code it is working
    DATA :
       BEGIN OF fs_itab,
          first(2) TYPE c,
          second TYPE c,
          third TYPE c,
          fourth(2) TYPE c,
       END OF fs_itab.
    DATA :
    t_itab LIKE STANDARD TABLE OF fs_itab.
    CLEAR fs_itab.
    fs_itab-first = 'AA'.
    fs_itab-second = 'Z'.
    fs_itab-third = 'Y'.
    fs_itab-fourth = 'AA'.
    APPEND fs_itab TO t_itab.
    CLEAR fs_itab.
    fs_itab-first = 'AA'.
    fs_itab-second = 'Z'.
    fs_itab-third = 'Y'.
    fs_itab-fourth = 'AA'.
    APPEND fs_itab TO t_itab.
    CLEAR fs_itab.
    fs_itab-first = 'AA'.
    fs_itab-second = 'Z'.
    fs_itab-third = 'Y'.
    fs_itab-fourth = 'CC'.
    APPEND fs_itab TO t_itab.
    CLEAR fs_itab.
    fs_itab-first = 'BB'.
    fs_itab-second = 'P'.
    fs_itab-third = 'Q'.
    fs_itab-fourth = 'DD'.
    APPEND fs_itab TO t_itab.
    CLEAR fs_itab.
    fs_itab-first = 'BB'.
    fs_itab-second = 'P'.
    fs_itab-third = 'Q'.
    fs_itab-fourth = 'BB'.
    APPEND fs_itab TO t_itab.
    LOOP AT t_itab INTO fs_itab.
      IF fs_itab-first NE fs_itab-fourth.
        DELETE TABLE t_itab FROM fs_itab.
      ENDIF.
    ENDLOOP.
    LOOP AT t_itab INTO fs_itab.
      WRITE :
         / fs_itab-first,
           fs_itab-second,
           fs_itab-third,
           fs_itab-fourth.
    ENDLOOP.
    Regards
    Pavan

  • Delete records from internal table

    hi all,
    i want to delete records from intenal table which are starting with a particular starting number .
    eg internal table
    10000
    20000
    90000
    91000
    92000
    88880
    i want delete the records starting with 9 i.e. 90000 91000 92000.
    Thanks in Adv
            RAJ

    You can test this piece of code.
    DATA:
    i_tab TYPE STANDARD TABLE OF mara,
    wa_tab TYPE mara.
    wa_tab-matnr = '1000'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '1001'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '1002'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '1003'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '2001'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '3001'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '4010'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Aug 8, 2008 4:49 PM

  • Delete records from multiple table

    Hi,
    I need to delete records from multiple tables using a single delete statement. Is it possible ? If so please let me know the procedure.
    Kindly Help.
    Thanks,
    Alexander.

    Hi Tim,
    Syntax of DELETE statement does not allow for multiple tables to be specified in this way. Infact, none of the DMLs allow you to specify table names like this.
    Technically, there are other ways of deleting from multiple tables with one statement.
    1. "Use a trigger":
    What was probably meant by this is that you have a driving-table on which you create a on-delete trigger. In this trigger, you write the logic for deleting from other tables that you want to delete from.
    This does mean a one-time effort of writing the trigger. But the actual DML operation of deleting from all the tables would be simply triggered by a delete on driving-table.
    2. Dynamic SQL:
    Write a PL/SQL code to open a cursor with table-names from which you want the data to be deleted from. In the cursor-for loop, write a dynamic SQL using the table-name to delete from that table.
    3. Using Foreign-Key constraint with Cascade-Delete:
    This I feel is a more 'cleaner' way of doing this.
    Having to delete data from multiple tables means that there is some kind of parent-child relationship between your tables. These relationships can be implemented in database using foreign-key constraints. While creating foreign-key constraint give the 'on delete cascade' clause to ensure that whenever data is deleted from parent-table, its dependent data is deleted from child-table.
    Using foreign-key constraint you can create a heirarchy of parent-child relationships and still your DELETE would be simple as you would only have to delete from parent-table.
    IMPORTANT: Implementing foreign-key constraints would also impact other DML operations that you should keep in mind.

  • How can i delete Record when i click on Delete Link in a report

    hi,
    i have to create report
    select S_NO,BILL_NO,LED_NAME,PUR_LED,VAT,BILL_DATE,ST_GRP_UND,GODOWN_NAME,
    ITEM_NAME,UNIT,QTY,RATE,PER,DIS,AMOUNT,'Delete' from DUMY_AC_LED_PURASEI want to delete corressponding record when i click on Delete Link.
    Here S_NO is P.k.
    How can i delete Record when i click on Delete Link.

    Manoj,
    If something does not work then you should report back on the same thread so that there is continuity to the whole episode. Be as lucid as you can be so that people know whats the scenario. E.g. is not working is not enough. What happens? Does is show error , go blank, goes to another page... all that is important.
    Its for posterity, down the line others will also visit the thread (may be).
    Regards,

  • How to identify new records in a table using OBIEE

    Hi,
    I have price change table as and when a record comes into this table i have to generate an alert. Then show a report with the price changes on which i can invoke an action to go into my transactional system to make the chnage. And once the change is made the process again starts to look for any new price chnage records that are recieved.
    Could anyone pls tell me how to identify new records in a table.
    Rgds

    SELECT ID, LastName, FirstName,
    RANK() OVER (PARTITION BY LastName,
    FirstName ORDER BY ID) AS SeqNumber
    FROM
    (SELECT ID, LastName, FirstName
    FROM Customers
    WHERE (LastName, FirstName) IN
    (SELECT LastName, FirstName
    FROM Customers
    GROUP BY LastName, FirstName
    HAVING COUNT(*) > 1)

Maybe you are looking for