当前位置:数据库 > Oracle >>

通过for update向Oracle的BLOB存储文件

通过for update向Oracle的BLOB存储文件
 
基础知识:
 
1.Oracle的BLOB空值     
 
01
Create table b(id varchar,obj blob);
02
Insert into b(id) values(“A”);
03
Insert into b(id,obj) values(“B”,empty_blob());
04
Insert into b(id,obj) values(“C”,’’);
05
Insert into b(id,obj) values(“D”,null);
06
Select id,obj from b;
07
   id     obj     length
08
-----------------------------------------
09
   A      0x        0
10
   B      0x        0
11
   C      0x        0
12
   D      NULL     NULL

 

2.SQL语法:for update  [of 。。]
 
数据库 oracle for update of   和   for update区别     
      select * from TTable1 for update 锁定表的所有行,只能读不能写 
      select * from TTable1 where pkid = 1 for update 只锁定pkid=1的行 
      select * from Table1 a join Table2 b on a.pkid=b.pkid for update 锁定两个表的所有记录 
      select * from Table1 a join Table2 b on a.pkid=b.pkid where a.pkid = 10 for update 锁定两个表的中满足条件的行 
      select * from Table1 a join Table2 b on a.pkid=b.pkid where a.pkid = 10 for update of a.pkid 只锁定Table1中满足条件的行 
      for update 是把所有的表都锁定;for update of 根据of 后表的条件锁定相对应的表 

 


Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,