When you say you can't alter the table, does this mean that you can't add a trigger? If you can add a trigger, then your problem is easy money. Create an "on insert" trigger that inserts the same row in to another table. Now, your program acceses this other table, reads a row, and now knows what was inserted on the original table. When you are done processing the row, you delete it. This way, you know what your program hasn't processed, because it is the contents of the second table.