title: Select and update in the same PL/SQL query
body: <p>I have a producer thread in Java pulling items from an Oracle table every n milliseconds.
  The current implementation relies on a Java timestamp in order to retrieve data and never re-retrieve them again.</p>
  
  <p>My objective is to get rid of the timestamp pattern and directly update the same items I'm pulling from the database.</p>
  
  <p>Is there a way to SELECT a set of items and UPDATE them at the same time to mark them as "Being processed"?</p>
  
  <p>If not, would a separate UPDATE query relying on the IN clause be a major performance hit?
  I tried using a temporary table for that purpose, but I've seen that performance was severely affected.</p>
  
  <p>Don't know if it helps, but the application is using iBatis.</p>