It's not who you are underneath, it's what you do that defines you

ORA-01036: 非法的变量名/编号

今天写程序时,往Oracle中插入二进制数据,出现错误ORA-01036:非法的变量名/编号,代码如下:

strSql = "INSERT INTO KA99 (KA991,KA992,KA994,KA995,KA997,KA998) VALUES(@KA991,@KA992,@KA994,@KA995,@KA997,@KA998)";

List<OracleParameter> parameters = new List<OracleParameter>();
parameters.Add(new OracleParameter("@KA991", "1"));
parameters.Add(new OracleParameter("@KA992", this.VersionNumberTextBox.Text));
parameters.Add(new OracleParameter("@KA994", loginUser.Name));
parameters.Add(new OracleParameter("@KA995", GetLocalIpv4()));
parameters.Add(new OracleParameter("@KA997", bprogram));
parameters.Add(new OracleParameter("@KA998", this.RemarkTextBox.Text));

一直报错ORA-01036: 非法的变量名/编号

网上查找后测试找到解决方式

strSql = "INSERT INTO KA99 (KA991,KA992,KA994,KA995,KA997,KA998) VALUES(:KA991,:KA992,:KA994,:KA995,:KA997,:KA998)";

byte[] bprogram = STZipToArray(this.FilePathTextBox.Text);
List<OracleParameter> parameters = new List<OracleParameter>();
parameters.Add(new OracleParameter("KA991", "1"));
parameters.Add(new OracleParameter("KA992", this.VersionNumberTextBox.Text));
parameters.Add(new OracleParameter("KA994", loginUser.Name));
parameters.Add(new OracleParameter("KA995", GetLocalIpv4()));
parameters.Add(new OracleParameter("KA997", bprogram));
parameters.Add(new OracleParameter("KA998", this.RemarkTextBox.Text));

posted @ 2015-06-26 16:19  金铭杰  阅读(1942)  评论(0编辑  收藏  举报

Brick walls are there for a reason :they let us prove how badly we want things