0

i created a oracle cursor in procedure , and loop that cursor to fetch data . at same time , another client insert or update the table that data will match my select criteria .

so when cursor finsihed , can all data got to client ?

4

1 回答 1

1

The set of data that a query will return is fixed at the instant that the query was started. That would be the point that the cursor was opened. If the other session's transaction is committed before your session opens the cursor, the cursor will return the new row. If the other session's transaction is not committed before your session opens the cursor, the cursor will not return the new row. It doesn't matter whether the data is fetched from the cursor a millisecond later or multiple days later (though it gets more and more likely that Oracle will be unable to reconstruct the state of the data as of the moment the cursor was opened the longer it remains open).

于 2013-11-12T02:36:20.397 回答