|
-
If you need the data based on the order it was inserted, then you need a trigger-populated field called INSERTED_TS that tells you when each record was inserted, period.
*DO NOT* use ROWID in production SQL! ROWID is useful for certain utility-type functions (finding duplicates, etc.), but should *never* be in a regular SQL statement in your application.
However, even if you don't follow this rule, you should know that the ROWID is simply an internal pointer to the physical location of the row on disk and has *no direct correlation* with when the record was inserted. There is a casual correlation in that the ROWID will generally increase as rows are added to the table because rows are *usually* added to the end. *However*, this is not a rule, just a usual occurence. As soon as any updates or deletes are performed on this table, your assumptions about ROWID go out the window. Even normal inserts can mess up the ROWID order depending on splits, etc.
So again, if you need to know when the row was inserted, then you need a column to capture and store that information. ROWID will not give it to you.
- Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|