Query1->SQL->Add("delete from rsgl_1 where PYM='"+Edit1->Text+"'" cascade);

解决方案 »

  1.   

    删除并重新建立从表的外键,select * from user_constraints where table_name='RSGL_1' and constraint_type='R';
    找到该外键的名字,然后:alter table rsgl_2 drop constraint 外键名字;
    alter table rsgl_2 add constraint 外键名 foreign key (bh) references rsgl_1(bh) on delete cascade;不过,好像你的表2上并没有加外键?
    那样就简单了,只需要添加外键就行了
    alter table rsgl_2 add constraint fk_rsgl_2$_bh foreign key (bh) references rsgl_1(bh) on delete cascade;
    注意:这时候,表1中的bh字段应该是主键或者唯一键