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的性能调整,一般包括两个方面,一是指Oracle数据库本身的调整,比如SGA、PGA的优化设置,二是连接Oracle的应用程序以及SQL语句的优化。做好这两个方面的优化,就可以使一套完整的Oracle应用系统处于良好的运行状态。
本文主要是把一些Oracle Tuning的文章作了一个简单的总结, ......
INSTR方法的格式为
INSTR(源字符串, 目标字符串, 起始位置, 匹配序号)
例如:INSTR('CORPORATE FLOOR','OR', 3, 2)中,源字符串为'CORPORATE FLOOR', 目标字符串为'OR',起始位置为3,取第2个匹配项的位置。
默认查找顺序为从左到右。当起始位置为负数的时候,从右边开始查找。
所以SELECT INSTR('CORPORATE FLOOR', 'O ......
#!/bin/ksh
#****************************************************************************
#
# (C) Copyright CPIC. 2008
#
# File name: check_db_alert.sh
# Project: Database Alerts Check
#
# Parameter : app_name -- name of db application(=ora ......
oracle dblink 的应用
url:http://blog.chinaunix.net/u/19820/showart_334013.html
1、用dblink链接oracle
(1)与平台无关的写法:
create public database
link cdt connect to apps
identified by apps using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.31.205.100)(PORT = 15 ......
转载
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 ......