Create Partition with function as range partition clause
255993Aug 2 2005 — edited Aug 3 2005Hi,
I've got a table with a date field, which I like to partition into 12 parts, depending on the month of the date field entry. My first attempt was, to use a create table statement like this:
CREATE TABLE TEST
(some_fields ....,
date_field DATE NOT NULL,
some_other_fields)
PARTITION BY RANGE (TO_NUMBER(TO_CHAR(date_field,'MM'))) (
PARTITION PARTITION_1 VALUES LESS THAN 2,
PARTITION PARTITION_2 VALUES LESS THAN 3,
....)
However, Oracle claims, that he is missing the right parenthesis after the TO_NUMBER in the range clause. This seems to be, because there are no functions allowed there. Does anybody have an idea how to solve this problem whithout creating a new column and inserting the month into that column by trigger.
Thanks and greetings,
Thorsten.