user1
user1

Reputation: 356

Deletion based on date of insertion of entry into table in Oracle

I want to know if oracle allows us to delete records from table which were inserted before a particular time and date if the table itself does not contain any Insertion_date column.

Upvotes: 0

Views: 340

Answers (2)

Dmitry.Samborskyi
Dmitry.Samborskyi

Reputation: 485

Oracle can show you table state on some time moment, for example:

SELECT * FROM some_table AS OF TIMESTAMP sysdate - interval '1' minute

Upvotes: 0

Rahul Tripathi
Rahul Tripathi

Reputation: 172418

The answer is NO. Oracle does not keep track of when a row was inserted. You have to create a column and add the data/time when the row was inserted to delete the row based on date. So in short you have to keep track of that by yourself.

Upvotes: 2

Related Questions