Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to create Primary key on partitioned column.

user1362938Jul 17 2020 — edited Jul 17 2020

Hello all,

I am trying to create primary key on partitioned column but I am getting below error.

ORA-01735: invalid ALTER TABLE option

01735. 00000 -  "invalid ALTER TABLE option"

*Cause:   

*Action:

I have below table ,

create table tbl_partition_pk_test

(

r_id varchar2(10),

r_name   varchar2(100),

crtd_date    date

)

PARTITION BY RANGE ("Crtd_DATE") INTERVAL (NUMTOYMINTERVAL(1, 'MONTH'))

(PARTITION "APR_20"  VALUES LESS THAN (TO_DATE(' 2020-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'));

then I am using below SQL to create pk.

alter table tbl_partition_pk_test add constraints tbl_partition_pk primary key (crtd_date, r_id) using local index;

Would you please help me to know what I am doing wrong here.

This post has been answered by Jonathan Lewis on Jul 17 2020
Jump to Answer
Comments
Post Details
Added on Jul 17 2020
6 comments
2,833 views