日期:2014-05-16  浏览次数:20405 次

oracle更新问题
软件环境 Windows 2000 + ORACLE9i?
硬件环境 CPU 1.8G + RAM 512M
?
现在我们有2张表?如下:
T1--大表 10000笔?T1_FK_ID
T2--小表 5000笔?? T2_PK_ID
T1通过表中字段ID与T2的主键ID关联
?
模拟数据如下:
--T25000笔数据
create table T2
as
select rownum id, a.*
?from all_objects a
?where 1=0;
?
-- Create/Recreate primary, unique and foreign key constraints
alter table T2
?add constraint T2_PK_ID primary key (ID);
?
insert /*+ APPEND */ into T2
select rownum id, a.*
????? from all_objects a where rownum<=5000;
?????
--T110000笔数据??????????
create table T1
as
select rownum sid, T2.*
?from T2
?where 1=0;
?
-- Create/Recreate primary, unique and foreign key constraints
alter table T1
?add constraint T1_FK_ID foreign key (ID)
?references t2 (ID);
?
insert /*+ APPEND */ into T1
select rownum sid, T2.*
????? from T2;
?
insert /*+ APPEND */ into T1
select rownum sid, T2.*
????? from T2;
?
?
--更新Subobject_Name字段,之前为null
update T2 set T2.Subobject_Name='StevenHuang'
?
我们希望能把T1Subobject_Name字段也全部更新成'StevenHuang',也就是说T1