Is it possible to drop a view after a certain date or if it older than 4 weeks etc.? |
Just out of curiosity: What is the particular reason your view will need to be dropped (and re-created?) after some time? Note, the "age" of an object can be found in system table SYS.SYSOBJECT in field "creation_time", such as select table_name, creation_time from SYS.SYSTAB ST key join SYS.SYSOBJECT SO where table_name = 'MyYoundView'; We want a plan to operate a certain time. The best is perhaps not remove it, maybe we should put conditions on it so it does not return any values?
(22 Mar '16, 09:35)
Rolle
Replies hidden
Well, we can't tell whether you would like to
outside that certain time. Both are possible, the former for example with the ALTER VIEW ... DISABLE clause, the latter with the help of a condition that returns false/unknown outside the desired interval, say, by filtering based on the current time or by checking the existence of a particular connection variable or by a flag in another table...
(24 Mar '16, 05:27)
Volker Barth
|
There is no built-in "expiry date" feature, but you could build your own using a CREATE EVENT ... SCHEDULE START TIME '12:01 AM' EVERY 24 HOURS statement.