Truncate table in Oracle getting errors

后端 未结 9 1417
忘了有多久
忘了有多久 2021-02-02 08:11

I got the problem is when I run following command in Oracle, I encounter the error.

Truncate table mytable;

Errors:

         


        
9条回答
  •  南旧
    南旧 (楼主)
    2021-02-02 09:05

    As mentioned by the error message, you cannot truncate a table that is referenced by enabled foreign keys. If you really want to use the truncate DDL command, disable the foreign key constraint first, run the truncate command, and enable it back.

    Reference: Difference between TRUNCATE, DELETE and DROP commands

提交回复
热议问题