oracle UPDATE 多表关联更新
update customers a
set city_name=(select b.city_name from tmp_cust_city b where b.customer_id=a.customer_id)
where exists (select 1
from tmp_cust_city b
where b.customer_id=a.customer_id
)
-- update 超过2个值
update customers a
set (city_name,customer_type)=(select b.city_name,b.customer_type
from tmp_cust_city b
where b.customer_id=a.customer_id)
where exists (select 1
from tmp_cust_city b
where b.customer_id=a.customer_id
)
========================
select * from path p,sd_mapnodes a
where p.aendnode=a.nm_node_id
update path p
set p.aendnode=(select s.ems_node_id from sd_mapnodes s where s.nm_node_id=p.aendnode)
where exists (select 1 from sd_mapnodes s where s.nm_node_id=p.aendnode)
select * from pathtrace pt,sd_mapnodes a
where pt.anode_id=a.nm_node_id
update pathtrace r
set (r.anode_id,r.znode_id)=(select s.ems_node_id,s.ems_node_id from sd_mapnodes s where s.nm_node_id=r.anode_id)
where exists (select 1 from sd_mapnodes s where s.nm_node_id=r.anode_id)
相关文档:
景:在windows xp server上安装了Oracle 9.2.0.1,现使用p4547809_92080_WINNT.zip将其升级到9.2.0.8版本,并打上最
新的安全补丁April 2008版。
1.升级oracle(administrator用户权限)(下载p4547809_92080_WINNT.zip网址:
ftp://updates.oracle.com/4547809/p4547809_92080_WINNT.zip)
(1)、压缩包名称为 p45478 ......
--锁的概念
锁出现在数据共享的场合,用来保证数据的一致性。当多个会话同时修改一个表时,需要对数据进行相应的锁定。
-- 锁的模式,有以下几种模式
0:none
1:null 空
2:Row-S 行共享(RS):共享表锁,sub share
3:Row-X 行独占(RX):用于行的修改,sub ex ......
CREATE OR REPLACE FUNCTION OFFICE.fbill_getbalance (billid NUMBER, total NUMBER)
RETURN NUMBER
IS
paid NUMBER;
balance NUMBER;
BEGIN
balance := total;
--get total paid
SELECT SUM (n_paidamount)
&nb ......
import java.net.url;
import java.sql.*;
public class javaoracle {
public javaoracle() {
}
public static void main(string[] args){
try
{
try{
class.forname("oracle.jdbc.driver.oracledriver");
}
catch(java.lang.classnotfoundexception e)
{
system.err.print(e.getmessage());
} ......
SQLServer和Oracle的常用函数对比
1.绝对值
S:select abs(-1) value
O:select abs(-1) value from dual
2.取整(大)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.取整(小)
S:select floor(-1.001) value
O:select floor(-1.001) value from dual ......