Delete all rows on VO at one shot

Hi,
I have a VO based on an EO. Now once I get a VO I could see that there are 2 methods:
1. removeCurrentRow()
2. remove()
removeCurrentRow() would delete the current row and also the related row of the table associated with the EO.
Is remove() the methods to remove all the rows linked to the VO or is there any other method. what does remove() do if not deleting the rows at one shot.
Thanks,
Kalyan.

<p>
Use this method in your Application Module:
</p>
<p>
<strong><font face="courier new,courier" size="2">public void removeAllRows(){</font></strong>
</p>
<p>
<strong><font face="courier new,courier" size="2">   ViewObject vo = getYourViewObject();</font></strong>
</p>
<p>
<strong><font face="courier new,courier" size="2">   vo.executeQuery();</font></strong>
</p>
<p>
<strong><font face="courier new,courier" size="2">   while(vo.hasNext()){</font></strong>
</p>
<p>
<strong><font face="courier new,courier" size="2">       Row r = vo.next();</font></strong>
</p>
<p>
<strong><font face="courier new,courier" size="2">       r.remove();
</font></strong>
</p>
<p>
<strong><font face="courier new,courier" size="2">   } </font></strong>
</p>
<p>
<strong><font face="courier new,courier" size="2">   getDBTransaction().commit;
</font></strong>
</p>
<p>
<strong><font face="courier new,courier" size="2">}</font></strong>
</p>
<p>
Kuba
</p>

Similar Messages

  • Delete command is not deleting all rows

    Hi All,
    Database version 10.2.0.2
    Delete command is not deleting all rows and deleting some subset of rows which it should delete, ever time I delete and do the roll back, next time it will delete some random rows, count is different everytime with in the range but not complete in anyway. see the following -
    select count(*) from test where evt_id in (select evt_id from test1);
    COUNT(*)
    27105
    delete from test where evt_id in (select evt_id from test1);
    16045 rows deleted.
    select count(*) from test where evt_id in (select evt_id from test1);
    11060
    rollback;
    Againg the same procedure -
    select count(*) from test where evt_id in (select evt_id from test1);
    COUNT(*)
    27105
    delete from test where evt_id in (select evt_id from test1);
    14320 rows deleted.
    select count(*) from test where evt_id in (select evt_id from test1);
    COUNT(*)
    12785
    why its not deleting all the 27k rows in one shot? Is there any bug related to that?
    Thanks
    Abhinav

    Odd that what looked like identical statements produced different results, both the counts and the deletes. The most likely cause of that is your data is changing - as Fahd suggested perhaps a simultaneous load taking place.
    The delete issue is probably not due to a bug. Possible but unlikely.
    If any evt_id values are NULL they won't be deleted with the subquery - a NULL in test.evt_id will never match a NULL in test1.evt_id.
    Have you tried alternative subqueries - a correlated EXISTS subquery for instance?

  • How to delete all the PSA data in one go

    Hello Guys,
    I want to clear all the data from all the PSA tables at one shot, how can i do this??
    I have tried following things:
    1) I have gone to PSA root node and right click and then clicked on delete PSA data, but its showing me all the datasources and when i am executing that, it is deleting one by one(that i means i need to select individual datasource, which i do not want).
    2) Above specified step runs RSPSADEL1 in background , so i doubt whether it deletes psa data only or complete Table?
    3)I got the info from other posts that there is a fm which is RSATREE_PSA_DELETE_BATCH, but i need to make myself clear whether this fm deletes only data or complete Table?
    I am using sap-bw 3.5.
    Regards,
    Dolly

    Hi,
    there is one easy way to delete data from PSA .You can create a process chain have one delete data from PSA step where you need to give PSA table name and request older than (no of days before which you want to delete data ).
    Execute it and it will delete all the data before specified no of days .You can add multiple PSA tables here and can delete whole data in one go .
    Regards,
    Jaya

  • Delete all rows in a table

    I have read two articles how to use sql adapter with delete.
    http://btsguru.blogspot.se/2011/10/wcf-sql-adapter-table-operations.html
    http://social.technet.microsoft.com/wiki/contents/articles/29146.biztalk-server-2013-crud-operation-with-wcf-sql-adapter-and-correlation.aspx?wa=wsignin1.0
    Is it a way to delete all rows in a table?
    I have tried to send <ns0:Rows>*</ns0:Rows> with no luck.
    Challan

    I'm not expert in Biztalk but one of the options to call stored procedure that contains the delete script:
    http://geekswithblogs.net/StuartBrierley/archive/2011/10/19/biztalk-server-2010---using-the-wcf-sql-adapter-to-make.aspx
    Sql Delete all rows from table Script:
    DELETE FROM table_name;
    or 
    TRUNCATE TABLE mytable;
    Trucnate vs Delete:
    http://www.mssqltips.com/sqlservertip/1080/deleting-data-in-sql-server-with-truncate-vs-delete-commands/
    Fouad Roumieh

  • Close all the open Application in one-shot ?

    Is there are any way to close all the open application in one shot in ipad rather than double-click the home button and close the apps one by one.

    In principle, I agree with you...
    But it appears that reality is not perfect. I observed on iPhone 3 that memory could be pretty clogged from time to time and I needed to restart it to free up memory and get it back to original speed again. It all depends on which apps you are running. Some appears to eat more memory than others. On iPhone 4, it appears to be less of a problem and I have seen that later iOS releases also makes this less of a problem. I only have a first generation iPad, but I have seen that later iOS releases have improved memory handling significantly there as well. However, it appears to be a good idea to reboot the device after a week or two just to flush the memory. I can't prove this theory scientifically, but I do see a difference in memory usage when doing this.
    The reason I actually tried "Process Killer" was a tip that it addressed the problems many of us encountered with the first iOS 5 release: frequent crashes and slow performance. After the pretty quickly released iOS 5 update, that wes pretty much solved, but occasionally killing processes actually helped me at that point, It made both my devices more stable.
    The original question was about battery performance, there I don't think that the amount of processes running is the key. A much better way of getting more out of your battery is shutting off location services in apps where they are not really needed. I would guess that turning off push notofications for as many apps as possible helps as well.
    Also, turn off the Personal Hotspot on iPhone when it's not needed!

  • How can you delete all the e mail at one time instead of one at a time?

    How can you delete all the e mail at one time instead of one at a time?

    you'd have to do it from the computer,

  • How do I leave delete all of my emails in one account

    How do I delete all of the email in one single account?  I have three accounts on my iPad.

    Aha, here is the trick:
    go to the mailbox you want to delete all the mail from
    select any one message
    press and hold the move button, and while you are still holding it, deselect the email you selected
    wait a few second
    it will select ALL the emails with an option to move, and you can move them to the trash.
    Unlike the select all method that used to be possible, you will not get a list of selected emails with the option to deselect some of them.  So if there were a few you wanted to keep, you will have to go to the trash box, find them and rescue them.

  • How to delete all rows data from database

    Hello All.
    I have a database username 'abc'. This database contain 123 tables & have many data.
    I want to empty all the database. Is it possible that clear all the database with a single query.
    if yes then kindly tell me about the query .
    Thanks
    Diamond

    Keep in mind that you cannot rollback the truncate command.
    Once you truncate a table all of it's data AND statistics are gone.
    If you do not want to use PL/SQL to delete all rows you can generate a script by SQL
    SCOTT@ORCL> SELECT ' TRUNCATE TABLE '|| TABLE_NAME||';' FROM USER_TABLES;
    'TRUNCATETABLE'||TABLE_NAME||';'
    TRUNCATE TABLE BONUS;
    TRUNCATE TABLE SALGRADE;
    TRUNCATE TABLE DEPT_LOV;
    TRUNCATE TABLE TITLE;
    TRUNCATE TABLE TEST_DATE;
    TRUNCATE TABLE DEPT;
    TRUNCATE TABLE REP;
    TRUNCATE TABLE REP_PARAM;
    TRUNCATE TABLE EMP;
    10 rows selected.
    SCOTT@ORCL> SELECT 'DELETE FROM '|| TABLE_NAME||';' FROM USER_TABLES;
    'DELETEFROM'||TABLE_NAME||';'
    DELETE FROM BONUS;
    DELETE FROM SALGRADE;
    DELETE FROM DEPT_LOV;
    DELETE FROM TITLE;
    DELETE FROM TEST_DATE;
    DELETE FROM DEPT;
    DELETE FROM REP;
    DELETE FROM REP_PARAM;
    DELETE FROM EMP;
    10 rows selected.
    SCOTT@ORCL>You can save the output in a .sql file and run it.
    Regards,
    Tony

  • Delete all rows except 10 random rows

    Hi,
    how can I delete all rows from table JOBS except 10 random rows?
    Someone asked it before (not here..): http://stackoverflow.com/questions/10820105/t-sql-delete-except-top-1
    but I didn't understand the answer, and I don't think it will work in PL/SQL.
    If the answer in StackOverflow does works in PL/SQL, I will glad if someone explains me with better example,
    If the answer in StackOverflow does'nt work in PL/SQL, I will glad if someone gives me an example.
    thanks!

    Actually I found a problem in this solution.
    delete from jobs where rowid not in (select rowid from jobs where rownum<=10) ;I used the above code to delete all rows except 10 in JOB_HISTORY table, but for some reason the rows that were chosen were only in the range in which (144<=EMPLOYEE_ID<=146).
    I tried this several times and always i stayed with rows in this range.
    Here are the queries:
    SQL> select employee_id from job_history;
    EMPLOYEE_ID
    144
    144
    144
    144
    144
    145
    145
    146
    146
    146
    146
    146
    146
    146
    147
    147
    147
    147
    149
    149
    149
    156
    156
    156
    156
    156
    156
    156
    158
    158
    158
    158
    158
    158
    158
    158
    159
    159
    159
    165
    165
    165
    171
    171
    171
    171
    46 rows selected
    SQL> delete from job_history where rowid not in (select rowid from job_history where rownum <= 15);
    31 rows deleted
    SQL> select employee_id from job_history;
    EMPLOYEE_ID
    144
    144
    144
    144
    144
    145
    145
    146
    146
    146
    146
    146
    146
    146
    147
    15 rows selected
    SQL>
    Glad if someone can explain me why I get this result.
    Thanks
    Edited by: 998093 on 05:01 05/04/2013

  • Delete all rows

    Hi All
    I'm using jd 11.1.2.0
    I have a table which displays some rows in a table. I want to delete all rows in the table when user presses the Delete button
    Please tel me how to do this
    Thaks

    try with this method
        public void deleteAll(){
                              // 1. Access the binding container
                   DCBindingContainer bc = (DCBindingContainer)getBindings();
                  // 2. Find a named iterator binding
                   DCIteratorBinding iter =
                     (DCIteratorBinding)bc.findIteratorBinding("YourIteratorName");
                   //4. Get the RowSetIterator Object
                   RowSetIterator rsi = iter.getRowSetIterator();
                    rsi.reset();
                   //delete all rows
                    while (rsi.hasNext())
                        rsi.removeCurrentRow();
                        rsi.next();
    }

  • After you delete individual text messages, the trash can will disappear and you can only DELETE ALL or cancel! It will come back after awhile but you can't delete everything you want to in one shot!

    AAfter you delete several individual text messages, your trash can will disappear, and then you'll only have the option to delete all or cancel

    And the message remains after a hard reset?
    Post relates to: None

  • JTable problem when deleting all rows and reinserting data,

    Hi,
    I have a JTable with an AbstractModelTable.
    Some cells in the JTable have a custom cell editor. I am using
    the cell editor that accepts only numeric values as explained in
    the JTable tutorial (WholeNumberField).
    - The JTable gets filled by choosing a value from a JList
    for example:
    1- choose a customer name from the customer JList
    2- gets the customer order (database)
    3- fills the Jtable with the customer data.
    - When a customer is chosen from the Jlist I call a function
    inside my table model. (This function removes all rows, clears the vector holding the data and calls fireTableRowsDeleted (firstRow, lastRow));
    - Then I fill up the new data for this customer.
    All of this works fine, except if I have entered a new value inside
    one of the cell that has a customed cellEditor (ex: the Ordered column).
    for example : user enters number 20 in the "ordered" column for customer A. Then changes his mind and chooses customer B from the JList. So the JTable gets cleared and refilled with the data of Customer B but the column "ordered" still has the value '20'
    I would really appreciate any help...
    Thanks

    Don't know is this will work, but try the following before updating the table:
    if (table.isEditing())
      table.removeEditor();Also, why do two TableModelEvent's..one for all getting deleted, one for the new filling. You could do one fireTableDataChanged after the new data is in.

  • Deleting all rows in detached mode hangs application

    Hi all,
    If we click on Detach button of table and do select all and delete , and click on detach button again (i.e to return to main screen), the screen gets hanged.
    Steps to reproduce:
    1.Go to [http://jdevadf.oracle.com/adf-richclient-demo/faces/components/table/updateableTable.jspx?|http://jdevadf.oracle.com/adf-richclient-demo/faces/components/table/updateableTable.jspx? ]
    2. Click Detach
    3.Select all rows and click Delete (choose the third delete button which says 'Multiple row deletes one event' in tooltip )
    4.Click on Detach button again.
    The screen hangs at this point
    Is this a bug ? Any workarounds for this issue.
    FYI, this behaviour is reproducible in Jdev 11.1.1.4 also
    Thanks,
    Vikas

    Is this a bug ? Any workarounds for this issue.You've got the perfect test case to take to https://support.oracle.com, who would be able to answer both of those questions.
    John

  • Deleting all the similar records except one

    I have a table without a primary/unique key, this table contains too many rows that have the same column values(the row is duplicated), How can I delete all the duplicated rows and keep one copy of this rows?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Waleed Dallah ([email protected]):
    I have a table without a primary/unique key, this table contains too many rows that have the same column values(the row is duplicated), How can I delete all the duplicated rows and keep one copy of this rows?<HR></BLOCKQUOTE>
    Hi
    This query may be solev ur problem
    delete table where rowid not in(select min(rowid) from table1 group by fieldname)
    This query if u want to keep latest row use max(rowid) instead of min(rowid)
    let me know
    by
    venkat
    ([email protected])

  • Multi Row Delelte - Delete all rows

    I have a multi row delete button with multi row checkboxes. When I tried to delete the selected rows, actually all rows are deleted. I have a multi row delete process.
    Other information:
    This tabular form displays all related users for one particular department. The department ID is the primary key in this reference table.
    I am using APEX 2.2 and IE as browser. Any one else here know what settings I should set.

    After review previous thread, I created the following PL/SQL expression for the multi row delete process in the condition field:
    FOR I IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
    DELETE FROM tbl
    WHERE colNM = APEX_APPLICATION.G_F02(APEX_APPLICATION.G_F01(I))
    END LOOP;
    END;
    I also tried htmldb_application.g_f01.count to reference the selected rows. Both of them are not working. Someone, please help, where should I put this PL/SQL expression. I am pretty to APEX.
    Thanks.

Maybe you are looking for