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));