ORACLE有没有级联修改功能? DGDJ们,SAVE ME!如果要分数,我++++ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 还有一种方法就是在建表的时候将级连的关系建上.example:create table primary_table(xh number(4),mc varchar2(30),constraint pk_primary_table primary key(xh));create table foreign_table(xh number(4),bh number(4),xmmc varchar2(30),constraint pk_foreign_table primary key(xh,bh),constraint fk_primary_table foreign key(xh) references primary_table (xh) on delete cascade);呵呵,还有就是按照楼上的,用触发器 另:如果建立了Foreign Key 关系后,如果想建立类似级联修改功能,是在 BEFORE UPDATE 还是在AFTER UPDATE后执行?我在考虑,2者不行的,因为有外键关系约束啊 建立如下触发器create or replace trigger updata_primary_table after update on primary_table for each rowdeclare begin update foreign_table set xh=:new.xh where xh = :old.xh;end updata_primary_table; 问个问题 oracel 数据库 两个时间错位相减 如何使用存储过程删除多个表 请教实现这样的功能的其他SQL写法(效率高点更好) 怎样实现ORACLE 数据库跨网段访问??? SQL问题 如何在oracle里面批量的插入数据,就是说这个脚本怎么写 oracle 的购买问题 25users 50users 1cpu的区别 oracle8i中sql查询的问题。 oracle9i如何备份到磁带机上呢?(急) Oracle9中PL SQL存储过程写文件的字符集问题,急求答案,解决后分数任意! 到底哪里错了!!!
example:
create table primary_table(
xh number(4),
mc varchar2(30),
constraint pk_primary_table primary key(xh));create table foreign_table(
xh number(4),
bh number(4),
xmmc varchar2(30),
constraint pk_foreign_table primary key(xh,bh),
constraint fk_primary_table foreign key(xh) references primary_table (xh) on delete cascade);呵呵,还有就是按照楼上的,用触发器
我在考虑,2者不行的,因为有外键关系约束啊
after update on primary_table
for each row
declare
begin
update foreign_table set xh=:new.xh where xh = :old.xh;
end updata_primary_table;