通过使用OleDb操作Oracle数据库,成功实现图片上传到Blob类型的字段,但有时会发生ORA-01036错误的问题,经查询是错误提示为 illegal variable name/number,不知道有谁能详细解释illegal variable name/number的意思
Oracle Data Provider for .NET
Hi
I am using ODP.NET (Oracle Data Provider for .NET) in my asp.net application.
I have a table in my oracle database called "equipmentgroup". When the page loads for the first time i retrieve all the records from the table to a dataset and save it to viewstate. Later on any addition or modification is done in the dataset only in disconnected mode. Finally,when user clicks update i call this function "update" which should do a batch update but instead it gives the following error :
"ORA-01036: illegal variable name/number "
private void update()
{
OracleParameter workParam;
OracleConnection cnn = new http://www.sharppower.com/" target=top>OracleConnection("Data Source=NEELESHR;User Id=tmse; Password=tmse;");
LOVE GUOXUE
string sql = "INSERT INTO EquipmentGroup (Code, Description, LifeTime, PriamryLife, Grading, Inflator, ExtensionRate, MaintenanceFee) VALUES (:Code, :Description, :LifeTime, :PriamryLife, :Grading, :Inflator, :ExtensionRate, :MaintenanceFee)";
OracleCommand cmd = new OracleCommand(sql,cnn);
cmd.CommandType = CommandType.Text;
OracleDataAdapter da = new OracleDataAdapter();
da.InsertCommand = cmd;
workParam = da.InsertCommand.Parameters.Add("Code",OracleType.Char,10,"Code");
workParam.SourceVersion = DataRowVersion.Current;
workParam = da.InsertCommand.Parameters.Add("Description",OracleType.VarChar,50,"Description");
workParam.SourceVersion = DataRowVersion.Current;
workParam = da.InsertCommand.Parameters.Add("LifeTime",OracleType.Number);
workParam.SourceColumn = "LifeTime";
中国网ZGWWW
workParam.SourceVersion = DataRowVersion.Current;
workParam = da.InsertCommand.Parameters.Add("PriamryLife",OracleType.Number);
workParam.SourceColumn = "PriamryLife";
workParam.SourceVersion = DataRowVersion.Current;
workParam = da.InsertCommand.Parameters.Add("Grading",OracleType.Char,10,"Grading");
workParam.SourceVersion = DataRowVersion.Current;
workParam = da.InsertCommand.Parameters.Add("Inflator",OracleType.Number);
workParam.SourceColumn = "Inflator";
workParam.SourceVersion = DataRowVersion.Current;
workParam = da.InsertCommand.Parameters.Add("ExtensionRate",OracleType.Number);
workParam.SourceColumn = "ExtensionRate";
workParam.SourceVersion = DataRowVersion.Current;
workParam = da.InsertCommand.Parameters.Add("MaintenanceFee",OracleType.Number); 中国国*万*维*网
workParam.SourceColumn = "MaintenanceFee";
workParam.SourceVersion = DataRowVersion.Current;
try
{
da.Update(ds,"EquipmentGroup");
}
catch(Exception e)
{
Message.Text = e.Message;
}
}
Hi,
I think that you should add parameters with ":" included, like:
workParam =
da.InsertCommand.Parameters.Add(":Code",OracleType.Char,10,"Code");
OleDb Data Provider for .NET
string sql = "INSERT INTO EquipmentGroup (Code, Description, LifeTime, PriamryLife, Grading, Inflator, ExtensionRate, MaintenanceFee) VALUES (?, ?, ?, ?, ?, ?, ?, ?, )";
Hi,
I think that you should add parameters with ":" included, like:
workParam =
da.InsertCommand.Parameters.Add(":Code",OracleType.Char,10,"Code");
分享到:
相关推荐
只需要安装oracle client在本地,然后配置好tns,输入连接名,用户名,密码,数据表的名称,文件名数据列名以及blob数据列名,就可以批量导出ORACLE数据库BLOB字段生成图片
C#访问oracle数据库类 1、执行非查询命令 2、执行查询命令 3、带blob字段读写
oracle查询blob字段照片(jpeg) 像素大小sql
很多朋友在操作oracle数据库的clob,blob字段时不知道怎么插入和使用,这里提供读写范例。
只需要安装oracle client在本地,然后配置好tns,输入连接名,用户名,密码,数据表的名称,文件名数据列名以及blob数据列名,就可以批量导出ORACLE数据库BLOB字段生成图片
java对oracle数据库中blob字段的处理
从oracle中的BLOB类型字段中取出照片,转存到mysql数据库中。思路是现将oracle中的照片存储在本地文件夹,在将本地图片上传到mysql中。
JDBC操纵Oracle数据库中的BLOB字段
kettle通过java代码将数据库blob 字段抽取到本地文件
基于JSP访问ORACLE数据库BLOB字段并显示图形的解决方案.pdf
此文档是对于oracle数据库中blob类型字段二进制大对象的读取和解析
oracle 存读数据库的blob字段 .net有两种方式向Oracle的blob字段中存储图片:
java中读取ORACLE中BLOB字段存储的图片
基于JSP访问ORACLE数据库BLOB字段并显示图形的解决方案
ORACLE数据库中主要字段类型的读写例子(包括:Long、Raw、Blob).docxORACLE数据库中主要字段类型的读写例子(包括:Long、Raw、Blob).docxORACLE数据库中主要字段类型的读写例子(包括:Long、Raw、Blob).docxORACLE...
ORACLE数据库中主要字段类型的读写例子(包括:Long、Raw、Blob).pdfORACLE数据库中主要字段类型的读写例子(包括:Long、Raw、Blob).pdfORACLE数据库中主要字段类型的读写例子(包括:Long、Raw、Blob).pdfORACLE...
Struts用 JDBC Blob字段 保存和读取 Oracle 数据库 好用 试过 有详细注释
图片BASE64加密保存到数据库Blob类型中(放入数据库,并取出生成图片),完整的demo例子,可运行。
简单写的一个小工具,把图片存入oracle中,按clob和blob两种方式存储,并读取图片
ORACLE数据库中主要字段类型的读写例子(包括:Long、Raw、Blob) (2).docxORACLE数据库中主要字段类型的读写例子(包括:Long、Raw、Blob) (2).docxORACLE数据库中主要字段类型的读写例子(包括:Long、Raw、Blob) (2)....