SQL*Plus: Release 9.2.0.6.0 - Production on Wed Aug 2 17:38:39 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
Ҏ(gu)一:
SQL> update wwm2
2 set town=(select town from wwm5 where wwm5.id=wwm2.id)
3 where id=(select wwm5.id from wwm5 where wwm5.id=wwm2.id)
4 /
8 rows updated.
Ҏ(gu)? 与方法一道理相同,q里需要掌握EXIST的相关用?
SQL> update wwm2
set town=(select town from wwm5 where wwm5.id=wwm2.id)
where exists (select 1 from wwm5 where wwm5.id=wwm2.id)
8 rows updated.
Ҏ(gu)?
SQL> update (select a.town atown,a.id aid,b.town btown,b.id bid from wwm2 a,wwm5 b where a.id=b.id)
2 set atown=btown
3 /
set atown=btown
*
ERROR at line 2:
ORA-01779: cannot modify a column which maps to a non key-preserved table
1* alter table wwm5 add primary key (id)
SQL> /
Table altered.
1 update (select a.town atown,a.id aid,b.town btown,b.id bid from wwm2 a,wwm5 b where a.id=b.id)
2* set atown=btown
SQL> /
8 rows updated.
q种Ҏ(gu)的局限性就是需要PRIMARY 的支?
Ҏ(gu)?
1 declare
2 cursor cur_wwm is select town,id from wwm5;
3 begin
4 for my_wwm in cur_wwm loop
5 update wwm2 set town=my_wwm.town
6 where id=my_wwm.id;
7 end loop;
8* end;
SQL> /
TOWN ID
-------------------- ----------
lllldf 111
ljjjjj 222
q个Ҏ(gu)是最灉|的了(jin).
Ҏ(gu)?
注意,Ҏ(gu)五只能适用于WWM5是WWM2的子集的时?
1 merge into wwm2
2 using (select town,id from wwm5) b
3 on (wwm2.id=b.id)
4 when matched then update set town=b.town
5* when not matched then insert (town,id) values (null,null)
SQL> /
9 rows merged.
SQL> select * from wwm2;
TOWN ID
-------------------- ----------
---注意q个地方,被插入了(jin)一个空?因ؓ(f)WWM5的ID=9984在WWM2中不能匹?Ҏ(gu)原因是ORACLE9必须有WHEN NOT MATCHED子句,但是ORACLE10可以不许?也就是ORACLE10可以不写WHEN NOT MATCHED ,׃必插入NULLg(jin),册个问?下一步会(x)DELETE WWM5的ID=9984,q样一来就不会(x)执行W(xu)HEN NOT MATCHED
222 222
lllldf 111
lllldf 111
llll 1111
dddd 2222
lllldf 111
lllldf 111
lllldf 111
lllldf 111
ljjjjj 222
TOWN ID
-------------------- ----------
lllldf 111
lllldf 111
ljjjjj 222
14 rows selected.
SQL> delete from wwm5 where id=9984;
1 row deleted.
SQL> 1 merge into wwm2
SQL> 2 using (select town,id from wwm5) b
SQL> 3 on (wwm2.id=b.id)
SQL> 4 when matched then update set town=b.town
SQL> 5* when not matched then insert (town,id) values (null,null)
SQL> /
1.java的classloader采用双亲委托的机?br />
2.当前cd载器和线E上下文的区别是Q当前类加蝲器在加蝲callercL已经定Q但thread's context classloader is modifiable
3.thread's classloader can break through the parent delegation mechanism of classloader
4.it is should keep the thread's classloader same as current class classloader
5.the default form of class.forname isn't recommend,because of exception of initializing static field if the classloader is not
destroied
6.banq comment about adoption thread's classloader is not correctly
所以我们来看第二种选择: 当前上下文环境下的类加蝲?/span>
. Ҏ(gu)定义, 当前cd载器是你当前方法所属的cȝ加蝲?/span>
. 在运行时cM间动态联~?/span>
, ?qing)调?/span>
Class.forName,() Class.getResource(){类似方法时, q个cd载器?x)被隐含C?/span>
. It is also used by syntactic constructs like X.class class literals.
]]>DELL XP Pro 来源 ?MD5http://www.aygfsteel.com/Jhonney/archive/2007/12/02/164667.htmlJhonneyJhonneySun, 02 Dec 2007 09:47:00 GMThttp://www.aygfsteel.com/Jhonney/archive/2007/12/02/164667.htmlhttp://www.aygfsteel.com/Jhonney/comments/164667.htmlhttp://www.aygfsteel.com/Jhonney/archive/2007/12/02/164667.html#Feedback1http://www.aygfsteel.com/Jhonney/comments/commentRss/164667.htmlhttp://www.aygfsteel.com/Jhonney/services/trackbacks/164667.htmlMD5Q?7505544DB716B451DB6CC33F1ABC0E3
2005N
原始攑և2006.07世纪时代论坛
]]>Dell OEM XP SP2的原版镜?/title>http://www.aygfsteel.com/Jhonney/archive/2007/12/02/164666.htmlJhonneyJhonneySun, 02 Dec 2007 09:45:00 GMThttp://www.aygfsteel.com/Jhonney/archive/2007/12/02/164666.htmlhttp://www.aygfsteel.com/Jhonney/comments/164666.htmlhttp://www.aygfsteel.com/Jhonney/archive/2007/12/02/164666.html#Feedback2http://www.aygfsteel.com/Jhonney/comments/commentRss/164666.htmlhttp://www.aygfsteel.com/Jhonney/services/trackbacks/164666.htmlDell OEM XP SP2的原版镜?/div>