How to rename a primary key in Oracle such that it can be reused

前端 未结 1 1832
旧时难觅i
旧时难觅i 2020-12-18 22:05

On Oracle, I create a table like this:

CREATE TABLE \"Mig1\"(
  \"Id\" INTEGER  NOT NULL
  , CONSTRAINT \"PK_Mig1\" PRIMARY KEY 
(
   \"Id\"  ) 
) 

T

相关标签:
1条回答
  • 2020-12-18 23:01

    There is an index associated with the primary key constraint, and it is probably still called "PK_Mig1". Try this:

    ALTER INDEX "PK_Mig1" RENAME TO "PK_XXX";
    
    0 讨论(0)
提交回复
热议问题