<i id='dow3h'><tr id='dow3h'><dt id='dow3h'><q id='dow3h'><span id='dow3h'><b id='dow3h'><form id='dow3h'><ins id='dow3h'></ins><ul id='dow3h'></ul><sub id='dow3h'></sub></form><legend id='dow3h'></legend><bdo id='dow3h'><pre id='dow3h'><center id='dow3h'></center></pre></bdo></b><th id='dow3h'></th></span></q></dt></tr></i><div id='dow3h'><tfoot id='dow3h'></tfoot><dl id='dow3h'><fieldset id='dow3h'></fieldset></dl></div>

    <small id='dow3h'></small><noframes id='dow3h'>

    <legend id='dow3h'><style id='dow3h'><dir id='dow3h'><q id='dow3h'></q></dir></style></legend>
  1. <tfoot id='dow3h'></tfoot>

      <bdo id='dow3h'></bdo><ul id='dow3h'></ul>
    1. 如何在 ALTER TABLE 语句中添加“ON DELETE CASCADE"

      How to add #39;ON DELETE CASCADE#39; in ALTER TABLE statement(如何在 ALTER TABLE 语句中添加“ON DELETE CASCADE)
    2. <i id='dI0ao'><tr id='dI0ao'><dt id='dI0ao'><q id='dI0ao'><span id='dI0ao'><b id='dI0ao'><form id='dI0ao'><ins id='dI0ao'></ins><ul id='dI0ao'></ul><sub id='dI0ao'></sub></form><legend id='dI0ao'></legend><bdo id='dI0ao'><pre id='dI0ao'><center id='dI0ao'></center></pre></bdo></b><th id='dI0ao'></th></span></q></dt></tr></i><div id='dI0ao'><tfoot id='dI0ao'></tfoot><dl id='dI0ao'><fieldset id='dI0ao'></fieldset></dl></div>

      <legend id='dI0ao'><style id='dI0ao'><dir id='dI0ao'><q id='dI0ao'></q></dir></style></legend>
    3. <tfoot id='dI0ao'></tfoot>
        <tbody id='dI0ao'></tbody>

        <small id='dI0ao'></small><noframes id='dI0ao'>

        • <bdo id='dI0ao'></bdo><ul id='dI0ao'></ul>

                本文介绍了如何在 ALTER TABLE 语句中添加“ON DELETE CASCADE"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我的表中有一个外键约束,我想向它添加 ON DELETE CASCADE.

                我已经试过了:

                <前>更改表 child_table_name修改约束 fk_name外键(child_column_name)在删除级联上引用 parent_table_name (parent_column_name);

                不起作用.


                外键已存在,外键列有数据.

                执行语句后得到的错误信息:

                <前>ORA-02275: 表中已存在此类引用约束

                解决方案

                您不能将 ON DELETE CASCADE 添加到已存在的约束中.您必须drop 并重新create 约束.文档a> 显示MODIFY CONSTRAINT 子句只能修改约束状态(即:ENABLED/DISABLED...).

                I have a foreign key constraint in my table, I want to add ON DELETE CASCADE to it.

                I have tried this:

                alter table child_table_name
                  modify constraint fk_name
                  foreign key (child_column_name)
                  references parent_table_name (parent_column_name) on delete cascade;
                

                Doesn't work.

                EDIT:
                Foreign key already exists, there are data in foreign key column.

                The error message I get after executing the statement:

                ORA-02275: such a referential constraint already exists in the table
                

                解决方案

                You can not add ON DELETE CASCADE to an already existing constraint. You will have to drop and re-create the constraint. The documentation shows that the MODIFY CONSTRAINT clause can only modify the state of a constraint (i-e: ENABLED/DISABLED...).

                这篇关于如何在 ALTER TABLE 语句中添加“ON DELETE CASCADE"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                SQL query to group by day(按天分组的 SQL 查询)
                What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                Include missing months in Group By query(在 Group By 查询中包含缺失的月份)

                  <tbody id='nO4XZ'></tbody>
                  1. <small id='nO4XZ'></small><noframes id='nO4XZ'>

                    <legend id='nO4XZ'><style id='nO4XZ'><dir id='nO4XZ'><q id='nO4XZ'></q></dir></style></legend>
                  2. <tfoot id='nO4XZ'></tfoot>
                    • <i id='nO4XZ'><tr id='nO4XZ'><dt id='nO4XZ'><q id='nO4XZ'><span id='nO4XZ'><b id='nO4XZ'><form id='nO4XZ'><ins id='nO4XZ'></ins><ul id='nO4XZ'></ul><sub id='nO4XZ'></sub></form><legend id='nO4XZ'></legend><bdo id='nO4XZ'><pre id='nO4XZ'><center id='nO4XZ'></center></pre></bdo></b><th id='nO4XZ'></th></span></q></dt></tr></i><div id='nO4XZ'><tfoot id='nO4XZ'></tfoot><dl id='nO4XZ'><fieldset id='nO4XZ'></fieldset></dl></div>

                      • <bdo id='nO4XZ'></bdo><ul id='nO4XZ'></ul>