Is it possible to do autoincrement
i having a column name order_no and that column should be autoincremented by 1 and i want to check if the order_no value is divisible by 3 and in next day order_no values should be cleared.how is it possible to do in oracle ?
Guest UserPosted Jun 30, 2014, 10:40 AM
there are multiple facets to your problem, lets solve 1-by-1
Auto increment can be achieved by below code, there is concept of IDENTITY in RDBMS dbs
For second you can write trigger at insert where if order_no is / 3 then you can add delete statement.
CREATE TRIGGER AfterInsertIntoTable AFTER INSERT ON identity_test_tab_values Delete identity_test_tab_values where identity_test_tab_values_id=3