1停掉“服务”中所有与oracle相关的服务2删除oracle安装之后产生的app目录3删除C盘中oracle文件夹中所有的文件4删除注册表中与Oracle相关的内容CTRL+R输入regedit 删除HKEY_LOCAL_MACHINE\SOFTWARE下的Oracle选项5点击开始键观察有无相关的Oracle程序组重启计算机,重新安装Orac;OracleCommand cmd = new OracleCommandsql, connforeach OracleParameter op in opc opParameterName, opOracleType, opSizeValue = opValue OracleDataAdapter da = new OracleDataAdaptercmddt = new DataTablequottablenamequot看下dtrows count是不是。
OracleCommandcmd = new OracleCommandcmdCommandText= strSQL定义oracle命令的文本内容fororacleParameter p in param将参数传入 p cmdExecuteNonQuery执行命令 上面基本上是一个完整的参数化sql,不同的数据库服务器sql语句中参数的占位符不同,上面用的是;new OracleParameterquotXMNRquot, OracleTypeVarChar, 20,new OracleParameterquotTZFquot,OracleTypeVarChar, 10试试看参数加“”前缀。
估计你用oracleparameter了参数绑定第一种可能是你绑定额参数跟你在sql语句中的占位符个数不一样,另一种可能是你绑定的参数跟oracle中的相应的数据类型不一致Oracle;OracleCommand cmd = new OracleCommandsql, connOracleParameter param_1 = new OracleParameterquotequipmentIdquot, equipmentIdparam_1OracleParameter param_2 = new OracleParameterquotequipmentNamequot, equipmentName + quot$quotparam_2OracleParameter。
new OracleParameterquotb_Passedquot,OracleTypeChar,1parameters0Value=usernameparameters1Value=passwordparameters0Direction=ParameterDirectionInputparameters1Direction=ParameterDirectionInputparameters2Direction=ParameterDirectionOutputtry getConnection为获得连接的方法;1 v$parameter是oracle数据库的动态字典表视图,它保存oracleparameter了数据库参数的设置值2 如果要修改其中的值有两种方式21 修改当前会话参数alter session set sql_trace=true 开启trace22 修改数据库全局参数alter system set 参数名称=参数值 scope=spfilememorybothscope是可选参数,scope=spfile只修改启动文件。
commandArrayBindCount = 1000commandCommandText = quotinsert into dept valuesdeptno, deptname, locquotint deptNo = new int1000string dname = new string1000string loc = new string1000new OracleParameterquotdeptnoquot, OracleDbTypeInt32;StoredProcedure foreach OracleParameter parameter in parameters parameter return command 201008114html这里可以得到启发,你存储过程应当有点问题,要返程集合,oracle当中一定要用到游标。
connection OracleParameter paras = new OracleParameter#34p_name#34,name, new OracleParameter#34p_totalRecords#34,count, new OracleParameter#34v_cur#34, OracleTypeCursor 返回的游标 paras1Direction = ParameterDirectionOutput paras2;new quot@contentquot, OracleTypeClobplsql的参数不是@吧,你下边都知道用quotnewscontentquot,这里也该是如此的哦clob类型 最大大小为4g1*数据库块大小,存储数据库字符集数据数据库块大小默认是8K2k16k看你用的oracle是什么版本的,如果是10g或以上。
不在每个解释了OracleParameter deptNoParam = new OracleParameterquotdeptnoquot, OracleDbTypeInt32deptNoParamDirection = ParameterDirectionInputdeptNoParamValue = deptNodeptNoParamOracleParameter deptNameParam = new OracleParameterquotdeptnamequot, OracleDbTypeVarchar2;OracleCommand cmd = connCreateCommandcmdTransaction = txcmdCommandText = quotdeclare xx blob begin dbms_lobcreatetemporaryxx, false, 0 tempblob = xx end quotnew OracleParameter quottempblob quot。
如果没有办法避免的话,下方写exceptionwhen value_error then #39数字超长#39定义变量时,如果是表的属性字段,最好用表属性%TYPE来定义变量后台调用的时候赋值Varchar2 的size,如果不赋值就会报错如new OracleParameterquotdddquot,OracleDbTypeVarchar2 不行,要赋值个字符长度new OracleParameterquot;方法执行完增到库里就变成19807000了,是OracleParameter我少给赋什么变量了吗,还是parameterDbType的类型我给赋值错了,oracle库里是number18,4,对应的DbType不是Decimal吗 追答 你试试用最简单的BindByname方式插入看看有没有问题 已赞过 已踩过lt 你对这个回答的评价是? 评论 收起 1条折叠回答 其他。
public void RunProcedurestring storedProcName, OracleParameter parameters OracleCommand cmd = new OracleCommandstoredProcName, getConnection cmdCommandType = CommandTypeStoredProcedure foreach OracleParameter parameter in parameters parameter。
上一篇: 腾讯网qq,腾讯网COM
联系电话:18300931024
在线QQ客服:616139763
官方微信:18300931024
官方邮箱: 616139763@qq.com