Viktor
Viktor

Reputation: 31

How to create Index-organized table with desc order

Could you please help me with creating IOT with three columns and one of them has to have desc order.

I've created the table, but it's not ordered by created_date desc.

My table:

create table audit_log (
     id integer,
     created_date timestamp,
     module_type_id integer,
     ...<other columns>...
     constraint pk_audit_log primary key (created_date, module_type_id, id)) 
organization index overflow;

I need IOT like constraint pk_audit_log primary key (created_date DESC, module_type_id, id)

Unfortunately, I couldn't find any resources on the web how to do it. Has anybody faced with any similar task or know how to create a script?

Thanks

Upvotes: 3

Views: 259

Answers (1)

Husqvik
Husqvik

Reputation: 5809

I don't think this is possible. A descending index is actually function-based index using Oracle internal function SYS_OP_DESCEND. And a primary index of an index organized table cannot be function-based.

Upvotes: 2

Related Questions