开发过程中,经常会用到oracle的参数来进行数据库的操作,有时候为了图方便,在声明OracleParameter 时,会经常使用 OracleParameter(string name, object value) 这个构造方法,
不确定类型而直接传值。一般情况下都不会有问题,但偶尔还是会碰到 ORA-01461: can bind a LONG value only for insert into a LONG column 的问题。
这个时候,就不能再使用 OracleParameter(string name, object value) 的构造了,应该采用 OracleParameter(string name, OracleType oracleType) ,
在声明参数时,明确参数的类型,之后再确定每个参数的值,这样进行操作,就不会有 ORA-01461 的问题了。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7925783/viewspace-1463132/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7925783/viewspace-1463132/