sqloracleoracle-sqldevelopercreate-tablerange-partitions

Invalid datatype for range function


I am trying to use range partition on a table for a column of type number. However, Oracle 12c throws an error saying it is an invalid data-type. I don't understand why/what is invalid in the command.

create table partition_tester (
    some_column number not null,
    another_column varchar2(10),
    partition by range(some_column) interval(10)
);

I am connecting to the database using SQL developer. It seems to have issue with the range function. On executing above script it throws:

Error report -
ORA-00902: invalid datatype
00902. 00000 -  "invalid datatype"
*Cause:    
*Action:

Any help is appreciated.


Solution

  • remove the comma after " another_column varchar2(10)," and specify at least one partition.

    create table partition_tester (
        some_column number not null,
        another_column varchar2(10))
        partition by range(some_column) interval(10)
        (   
           partition p0 values less than (10) 
        )