Deleting rows from a table

COuld anyone tell me how to delete rows from a table which has millions of rows.
TIA,
Oracle user

if you are deleting all the rows, use "truncate table" in sql*plus.
or if you are deleting all but a handful of rows, then copy the rows you still want to a spare table, drop the original table, and rename the spare table back to the original table's name.
hope this helps

Similar Messages

  • Deleting Rows From A Table After Running a Report

    I've created a report that inserts rows into a table on the asp page then calls a BI Publisher report to display the data. After running the report in BI Publisher I need to delete the rows from the table that had just been inserted. How is the best way to go about this in BI Publisher?

    The best way I know of would be to use an "afterReport trigger".
    An afterReport trigger fires after the XML output has been generated.
    Thanks,
    Bipuser

  • Deleting row from a table binded to a matrix

    Hi all
    i have a form with a matrix binded to a user table which is handled as a Master Data lines by UDO.
    i want to enable deleting lines from the table by selecting a row in the matrix and clicking a delete button.
    currently i'm handling the click event by usint the method DeletRow of the matrix object.
    when i press the Update button (UID = "1"). the fact that a row was deleted from the matrix does not affect the bounded table.
    my question is how in code can i cause the deletion of a row from the matrix to also be deleted from the database table?
    appreciate the help
    Yoav

    Hi Yechiel
    flushToDatasource make the following:
    Flushes current data from the GUI to the bounded data source using the following process:
    1)Cleans the data source.
    2)Copies each row from the matrix to the corresponding data source record.
    In other words: This method load data from Matrix to DataSource (but not to database)
    the next step is update database from userdatasource
    Note: You migth read sdk help for more information

  • Deleting rows from one table while filter condition lies into another table

    Hi All,
    I'm facing a problem deleting a row from a table where the condition lies in other table. To ealaborate the scenario further let's say I have two table T1 (transaction table) and T2 (Master Table). I want to delete a record from table T1 by checking some conditions lies in table T2.
    I tried with the below query but this query deleting records from both the table.
    DELETE FROM ( SELECT * FROM T1 top INNER JOIN T2 tp
    ON top.TID = tp.TID
    WHERE top.DEAL_SITE_ID = inputparameter1
    AND (TP.SEGMENT <>inputparameter2 OR tp.segment is not null));
    Here the record is getting deleted from both the tables but I don't want to delete data from my master table i.e table T2.
    Any help would be highly appreciated. Thanks in advance.
    Regards,
    Subhadeep

    SQL> select *
      2   from the_table;
    X          Y
    AA         a
    BB         a
    CC         a
    AA         b
    DD         b
    SQL> select *
      2   from the_table_2;
    X          Y
    AA         a
    BB         a
    CC         a
    SQL>  delete from
      2  (
      3  select *
      4  from the_table  t1 inner join the_table_2 t2
      5  on  t1.x = t2.x
      6  and t1.y = t2.y);
    3 rows deleted.
    SQL> select *
      2   from the_table;
    X          Y
    AA         b
    DD         b
    SQL> select *
      2   from the_table_2;
    X          Y
    AA         a
    BB         a
    CC         a

  • Prevent user from deleting rows from all tables in his own schema

    Hi,
    How can I prevent user from deleting rows in all tables in his own schema.
    I want the user to not able to delete rows from any existing or new tables that might be added in the future.
    The user does not have the "DELETE ANY TABLE" system privilege.
    Please advise.
    Thanks.

    Nowadays, I'd also avoid triggers (if possible).
    Sometimes, when I daydream, I'm rewriting a few applications that I've contributed to as a newbie, and I'm very ashamed of it nowadays.
    From what I've experienced, in retrospective, the emphasis on teaching 'Oracle stuff' has been lying far too much on PL/SQL row-by-row oriented processing instead of letting Oracle 'crunch' sets at once.
    Most of my debugging hours ended up in discovering one or more database triggers 'doing stuff automagically'.
    Another nice blogpost: http://rwijk.blogspot.com/2007/09/database-triggers-are-evil.html
    Regarding OP's question:
    I would just rethink/reconsider this requirement completely.
    Correctly implementing privileges and roles seems the best way to go, yes.
    Triggers? Nah...
    pre-post-edit, noticed thread got updated just before posting
    Don't know what you mean with 'namedropping', but I think it's legitimate to point other readers to interesting Oracle related opinions/articles that do have a technical background and lots of interesting examples.
    post dreaded OTN outage edit (from here)
    Again: I would just rethink/reconsider this requirement completely.
    Both trigger/vpd are being used to hide a design flaw here.

  • Deleting rows from a table matching values from an ascii file

    Hi All,
    I have an ASCII file with 12,000 lines. Each line represents a value (you may call this as bad data) that matches a database column value in table. I have to delete all the rows from a database table (~ 400,000 rows) where a column value matches the bad data value. Linux is the OS is where SQLPLUS client is installed and I can execure any SQL queries from this Linux server. Oracle DB server is 10g.
    Any input on how to do this will be helpfull to me. I am not a database programmer so if any details will be appreciated.
    Thanks

    Hi,
    That's going to be very slow (among other problems) if you don't have the bad data in a table. An index-organized table would probably be best.
    Assuming the data data are uinique strings, up to 30 characters long, and that you don't need any other columns, you can create a table like this:
    CREATE TABLE  bad_data
    (   bad_txt    VARCHAR (30)
    ,  CONSTRAINT  bad_data_pk  PRIMARY KEY (bad_txt)
    ) ORGANIZATION INDEX;SQL*Loader is one way of getting the data from the file (doesn't have to be on the database server; it can be on your client machine) into the table.
    Once you have a table, actually removing the rows from the big table might be as simple as:
    DELETE  big_table
    WHERE   column_a  IN
            (   SELECT  bad_txt
                FROM    bad_data
    ;

  • DELETED rows from internal table

    Hi Experts,
    If I delete row/s from an internal table
    using the command DELETE ADJACENT DUPLICATES,
    is there a way to get these deleted rows.
    Thanks in advance.
    Rose

    Hi roselie,
    1. ofcourse not.
    2.hence, before that,
      u can declare another internal table,
      similar to original,
      and use like this.
    3. ITAB1[]   = ORIGINALITAB[].
    regards,
    amit m.

  • How to delete rows from multiple tables when pressing button

    Hi, I'm wondering how do I delete a row from two different tables at the same time when I press the Delete button. Both tables have GROUP_ID as their primary key.

    Nevermind! I realized that I had "reset" before my process to delete from the 2nd table.

  • Deleting Row from Advanced Table Region

    Dear Members,
    I have an OAF Page where I am using Advanced Table Region to display the data of a table.
    As soon as the page opens I am displaying one line in Advanced Table Region. In this region I have also given a button called ADD ANOTHER ROW +(using the feature of ADVANCED TABLE COMPONENTS, FOOTER, TABLE FOOTER , ADD TABLE ROW)+.
    So when user clicks on this button a new row will be added. Now if user wants to delete it how to achieve this.
    Kindly please help me in achieving this functionality.
    Many thanks in advance.
    Best Regards,
    Arun Reddy D.

    Hi Arun,
    First you need to create a button or image called Delete on your Advanced table region.
    Action Type : firePartialAction
    Event: delete
    Then In your CO PFR , write the below code
        if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
          String rowRef = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
          OARow row = (OARow)am.findRowByRef(rowRef);
          row.remove();
        }Hope this helps. :)
    Thanks,
    SK
    Edited by: SK on Feb 9, 2011 5:21 PM

  • Programatically Deleting Rows from a Table?

    I need to do some background cleanup tasks that include saving some data and deleting some data into the database. I'm trying to implement this in an extension framework class so that when 'real' application development begins, this background chore code will already be implemented.
    I'm creating view objects programmatically to retrieve data, but I don't know how to insert rows or delete rows. Delete statements in view objects fail since they aren't select statements, and code like:
    cleanupView.remove();
    raises "cleanupView is read-only" errors, since there aren't any entity objects defined for it (I assume, anyway).
    How can you insert and delete rows programmatically from a framework extension?

    My application of this technique is in a framework extension for generic housekeeping chores whose logic I'd like to keep out of the primary application. As such, it isn't possible to use EO and VO's declaratively.
    For anyone else who may travel this path, from the framework extension you can create views and execute DML statements like this: (In this case, in my AppModuleImpl extension)
    ViewObject myView = getDBTransaction().getRootApplicationModule().createViewObjectFromQueryStmt("myView","select * from mytable");
    myView.executeQuery();
    and when you're done:
    myView.remove();
    For DML, it's done by:
    getDBTransaction().executeCommand("delete mytable");
    getDBTransaction().executeCommand("commit");
    I concur that in 'normal' operations this isn't the best way, but rules can never be absolute.

  • Delete row from Advanced Table

    Hi,
    I'm trying to follow the Delete exercise to create a table with delete image for my project. We don't need to have switcher and confirm dialog as exercise does.
    My table only has three columns: fromDate, endDate and delete.
    I got issue if I entered two dates value then click delete image immediately, then pageContext.getParameter("fromDate") and getParameter("endDate") will return empty string.
    I have to click Add another row to reload page then getParameter will return values.
    How do I resolve this issue?
    Thanks in advance!
    KJ

    One approach is to manually empty the fields. But a better approach will be to include an action button on each row to clear the entries programmatically.
    --Shiv                                                                                                                                                                                                                                                                                                                                           

  • Delete rows from fnd tables

    hai folks,
    right know in my fnd_concurrent_request table nealry 2 lakhs rows are there(clon instance)
    can i delete these rows manually.is it recommended?
    tell me how can i clen up fnd tables.
    regards
    dba

    To run the Purge Concurrent Request and/or Manager Data program:
    1. Log in to Application as System Administrator responsibility.
    2. Navigate to Request> Run> Single Request
    3. Query up Purge Concurrent Requests.
    4. Enter 3 for age parameter so that it keeps only 3 days data in the tables and 3 days output/log files in the file system.
    The following tables will be purged:
    FND_CONCURRENT_REQUESTS
    This table contains a complete history of all concurrent requests.
    FND_RUN_REQUESTS
    When a user submits a report set, this table stores information about the
    reports in the report set and the parameter values for each report.
    FND_CONC_REQUEST_ARGUMENTS
    This table records arguments passed by the concurrent manager to each program
    it starts running.
    FND_DUAL
    This table records when requests do not update database tables.
    FND_CONCURRENT_PROCESSES
    This table records information about Oracle Applications and operating system
    processes.
    FND_CONC_STAT_LIST
    This table collects runtime performance statistics for concurrent requests.
    FND_CONC_STAT_SUMMARY
    This table contains the concurrent program performance statistics generated by
    the Purge Concurrent Request and/or Manager Data program. The Purge Concurrent
    Request and/or Manager Data program uses the data in FND_CONC_STAT_LIST to
    compute these statistics.
    FND_CONC_PP_ACTIONS
    Stores the post request processing actions(e.g., print, notify) for each
    submitted request. There's a concurrent_request_id here for each request_id
    in the FND_CONCURRENT_REQUESTS.
    FND_RUN_REQ_PP_ACTIONS
    Stores the post request processing actions(e.g., print, notify) for
    submitted request set programs that are stored in FND_RUN_REQUESTS

  • HR - delete rows from internal table

    Hello everyone,
    First of all sorry for my bad english.
    I am programming in the HR module. My program has a selection-screen where the user enters a date.
    In my program I do GET pernr, and my declared infotypes automatically get their data.  The thing is, now I want to delete the rows that do not correspond to the date in the selection screen.
    My date is stored in a range.
    thanks in advance

    For example try like this,
    delete itab where lgort not in r_lgort[].
    or you can loop the internal table and process the records which matches the date in the range table.

  • Delete row from internal table using field symbol.

    Hi friends,
      I created dynamic internal table using field symbol. I want to delete some data using where clause.
    for example. i want to use like,
        DELETE <FS> WHERE KUNNR = WA_KNA1-KUNNR.
    Like the above statment it won't work. How i can use delete with where clause in field symbols.
    Hope any one can help me.
    Thanks and regards
    Srikanth. S

    hi Srikanth,
    I think you have to LOOP through the whole internal table and check each line and decide to delete or not:
    LOOP at <itab> INTO <wa>.
    ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <wa> TO <field>.
    CHECK <field> IS ASSIGNED.
    IF <field> EQ WA_KNA1-KUNNR.
    DELETE ...
    ENDIF.
    UNASSIGN <field>.
    ENDLOOP.
    hope this helps
    ec

  • Deleting data from EDPAR table

    hi  everyone,
                               I need to delete data forom table EDPAR. two conditions are there. Once through first radio button in selection screen based on values of kunnr selected from select options. In the second case. if i select the second radio button, all data from EDPAR table gets deleted.
    Can any one offer me proper CODE  to do it....Pls help.

    SAP delivers a standard transaction to edit the contents of this table, VOE4, this is safer then using a custom code to delete rows from the table.

Maybe you are looking for

  • Installing Windows XP on a MacBook - Steps?

    I found a few threads about installing XP on my Macbook. But want to make sure I got it all before I start. Here's my situation... - Used Macbook with SuperDrive and 60GB hard drive (tiny) - Will mostly be used as a Mac - mainly for backing up CF car

  • Writing to hidden file

    I created a text document in a folder and made it hidden (using file properties). This also seems to have made it read-only, but in the file properties, the read-only checkbox is not checked. Is there a different procedure for writing to a hidden fil

  • Multilevel BOM Explosion

    Hi All, I am using one Function Module "CS_BOM_EXPL_MAT_V2" for multilevel BOM explosion. Input parameters for Function Module.. 1. Finished Goods(Material) 2. Application. 3. Explosion Date 4.Plant 5.BOM Usage. 6. Alternate BOM. Output  we are intre

  • Need to create view ( Urgent )

    Hi All, I have one requirement to create a view .Presently we are using a packaged procedure(view_test_123_pkg) to extract part numbers to write to a file using utl_file package. Now the requirement is to create a single column view to extract part n

  • Problem with append mode in  WS_DOWNLOAD

    Hi everybody I have a problem with downloading two internal tables in one excel sheet. I am Using FM - WS_DOWNLOAD , MODE = 'A' . I want to append one IT after another . But I am getting only the second one ... MODE - A is for append , correct? Any c