I am trying to create a partitioned table as follows -
CREATE TABLE test1 (
id NUMBER(18,0),
text VARCHAR2(1024)
)
partition BY RANGE
( TO_DATE(substr(id,1,8),'yyyymmdd')
) INTERVAL ( numtodsinterval(1,'DAY') )
( PARTITION "P0"
VALUES LESS THAN ( TO_DATE(' 2016-01-01 00:00:00','SYYYY-MM-DD HH24:MI:SS','NLS_CALENDAR=GREGORIAN') )
);
When I try and run this statement I get the error as follows -
ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis"
My guess is no functions are allowed while specifying partition key column.
Now, the data in the id column is of the following format -
YYYYMMDDNNNNNNN
YYYY is the year
MM is the month
DD is the day
NNNNNNN is a sequence/random number
I am trying to extract the first 8 digits convert it to date and partition the table on that derived column value.
Is this something possible? Any suggestions on how this can be achieved will be greatly appreciated.