Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create Partition with function as range partition clause

255993Aug 2 2005 — edited Aug 3 2005
Hi,

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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2005
Added on Aug 2 2005
7 comments
1,133 views