Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SELECT and read-consistentcy

Re: SELECT and read-consistentcy

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 29 Jul 1999 16:30:23 GMT
Message-ID: <37aa816b.106235528@newshost.us.oracle.com>


A copy of this was sent to Tony Rozga <rozga_at_derby.com> (if that email address didn't require changing) On Thu, 29 Jul 1999 09:38:53 -0600, you wrote:

>Hello,
>
>We have an application that archives and optionally deletes large data
>sets based on user-defined filters (for example, all entities in this
>date range, etc.). Is there anything wrong with this pseudo-code:
>
>SELECT all entities in the filter range
>
>rowsArchived = 0
>FOREACH row
> - increment rowsArchived
> - perform archive on current row
> - IF rowsArchived == userSpecifiedBatchSize THEN
> - execute DELETE statement that deletes the rows
> that have been archived
> - rowsArchived = 0
> ENDIF
>ENDFOR
>
>In terms of that code, does the DELETE statement (or any other database
>activity) affect the result set of the original SELECT statement?
>

The result set of the SELECT is fixed at the time the cursor is open -- the delete will not be visible to it at all.

>Thanks for your help and sorry if this is Oracle 101.
>
>Tony Rozga

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Jul 29 1999 - 11:30:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US