Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Oracle12c – Can't create a table with partitioning "ORA-00922: missing or invalid option"

I am trying to create a table with partitions but, I constantly get the same error. The exact oracle version is 12.1.0.2.0

create table toys (
  name varchar2(10),
  weight number,
  color varchar2(10),
  PRIMARY KEY (name)
)
partition by list (color) partitions (
  partition p_green values ('green'),
  partition p_red values ('red')
);

Is there some other prerequisite that must be done before I can created a partitioned table ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

VALUES keyword is required:

create table toys (
  name varchar2(10),
  weight number,
  color varchar2(10),
  PRIMARY KEY (name)
)
partition by list (color) -- partitions  -- removed
                          -- automatic
(
  partition p_green VALUES('green'),
  partition p_red VALUES('red')
  --,partition p_def VALUES(DEFAULT)
);

db<>fiddle demo

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading