I would like generate a list of partition without having to manually type them and I can also choose how many partition I want to create. I'm using partition by range. Please see below example.
P_PARTITION_20120830 VALUES LESS THAN ('2012-08-30')
P_PARTITION_20120930 VALUES LESS THAN ('2012-09-30')
P_PARTITION_20121030 VALUES LESS THAN ('2012-10-30')
...
and so on
This is what I have come up so far.
select 'P_PARTITION_' || to_char(add_months(sysdate, 1),'YYYYMMDD')
|| ' VALUES LESS THAN ' || to_char(sysdate, '(''YYYY-MM-DD'')')
from dual;
Any feedback would be appreciated. Thank you.