CREATE TABLE interval_event_history (
event_history_id NUMBER (10),
event_date DATE,
event_name VARCHAR2 (50),
event_type VARCHAR2 (1),
event_desc VARCHAR2 (500)
)
PARTITION BY RANGE (event_date)
INTERVAL (NUMTOYMINTERVAL (1, ‘YEAR’))
(PARTITION p2009 VALUES LESS THAN (TO_DATE (‘20100101’,‘YYYYMMDD’)),
PARTITION p2010 VALUES LESS THAN (TO_DATE (‘20110101’,‘YYYYMMDD’))
);
INSERT INTO interval_event_history VALUES
(1, ‘01-MAR-09’, ‘Circus’, ‘Q’, ‘Ringling Bros Circus’);
INSERT INTO interval_event_history VALUES
(2, ’04-JUL-10’, ‘Fireworks’, ‘Y’, ‘LA July 4 Fireworks’);
The inserts will succeed and the table structure will remain the same because the dates fall within the predefined ranges. When the following insert is done:
INSERT INTO interval_event_history VALUES
(1, ’05-DEC-11’, ‘Christmas’, ‘Y’, ‘Christmas Festival’);