10 pts.
 do_while how can i use do while statement to delete certain rows based on the rowcount?
how can i use do while statement to delete certain rows based on the rowcount??

Software/Hardware used:
ASKED: October 3, 2008  8:34 PM
UPDATED: October 6, 2008  12:03 AM

Answer Wiki:
"rowcount" does not really exist as part of the data. It is something generated at the moment of retrieving the data from the database, so you cannot use it to delete or update rows. One option could be the rowid, but depending on what you want to accomplish, I think a better option is to use a cursor for loop, defining your cursor as "for update", in order to be able to take advantage of the "where current of" condition. Example: <pre>create or replace procedure TEST is cursor test_cursor is select * from your_table for update; begin for i in test_cursor loop delete from your_table where current of test_cursor; end loop; end;</pre> -Carlosdl
Last Wiki Answer Submitted:  October 3, 2008  11:52 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _