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; 求大神指点SQL语句。。。 在plsql执行有结果的语句,到了程序中得到的值一直是NULL oracle 报警日志无效问题 这条SQL语句怎么写? 高手帮忙看一下,PROCEDURE 不能编译 ,急!在线等 oracle 10g日志查看方法 关于oracle自动备份的问题 求助:为什么我的这个触发器中的:old,:new不起作用? 关于监听服务 windows系统,oracle连接本地服务器,报错“ORA-12523” 监听程序无法找到适用于客户机连接的例程 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;