C#环境下往oracle中的blob字段插入文件
添加引用
using System.Data.OracleClient;
主要用到了两个类
System.Data.OracleClient.OracleConnection 表示一个到数据库的连接。此类无法继承。
System.Data.OracleClient.OracleCommand 表示针对数据库执行的 SQL 语句或存储过程。此类无法继承。
m_path为已经获取的文件名(full name)
表FJ_S中定义了三个字段XM_ID(varchar(50)),XM_NAME(varchar(50),FJ_FILE(blob)
private bool InputRecordToOracle(string sFilePath
{
if (m_Path == null)
{
return false;
}
//获得文件流
System.IO.FileStream pFS = new System.IO.FileStream(m_Path, FileMode.Open, FileAccess.Read);
Byte[] pBuffer = new Byte[pFS.Length];//把文件转成Byte型二进制流
pFS.Read(pBuffer, 0, pBuffer.Length);//把二进制流读入缓冲区
pFS.Close();
try
{
string sConnecStr = "Data Source=*;User ID=*;Password=*";
OracleConnection pConn = new OracleConnection(sConnecStr);
&n
相关文档:
在做项目经常遇到分科室、人员进行汇总的问题,在ORACLE中对此类问题的处理相当方便!下面以项目中遇到的实例进行说明:
查询语句如下:
select f_sys_getsectnamebysectid(a.sectionid) as sectname,
--a.sectionid,
f_sys_employin ......
数据库是一个多用户使用的共享资源。当多个用户并发地存取数据时,在数据库中就会产生多个事务同时存取同一数据的情况。若对并发操作不加控制就可能会读取和存储不正确的数据,破坏数据库的一致性。
加锁是实现数据库并发控制的一个非常重要的技术。当事务在对某个数据对象进行操作前,先向系统发出请求,对其加锁。加锁后 ......
官方文档:http://tahiti.oracle.com/
metalink:http://metalink.oracle.com
itpub:www.itpub.com
TOM:asktom.oracle.com
oracle forum:http://forums.oracle.com/forums/main.jspa?categoryID=84
OTN:http://www.oracle.com/technology/index.html
www.oracle.com.cn
www.eygle.com
Oracle ERP
www.erp10 ......
create or replace procedure check_records (ikbid in number,ikch in varchar2 ,ixh in varchar2,ixnd in varchar2,ikkxq in varchar2,info out varchar2,msg out varchar2)
as
v1 number;
v2 number;
v3 number;
begin
select XZRS into v2 from KCB_JW where KCH=ikch;
select count(*) into v3 fro ......
转载
DML statements on temporary tables do not generate redo logs for the data changes. However, undo logs for the data
and redo logs for the undo logs are generated. Data from the temporary table is automatically
dropped in the case of session termination, either when the user logs o ......