Home > Software engineering >  Oracle problem creating index organized table using "create as" statement
Oracle problem creating index organized table using "create as" statement

Time:11-12

So I'm trying to create a copy of one of my tables into an index organized table, However I get an error, here is the code.

create table clients2 as
select *
from clients
organization index;

ORA-00933:"SQL command not properly ended"

CodePudding user response:

Your command is wrong.

SQL> create table testiot ( object_id primary key,object_name ) 
     organization index 
     as select object_id,object_name from dba_objects 
     where object_id is not null ;

Table created.

SQL> select count(*) from testiot ;

  COUNT(*)
----------
    208730

Organization index must be in the definition of the table and before as select. On the other hand, you need to define the columns in the table and which one is the primary key for IOT.

  • Related