我有这段代码用于将值插入到oracle数据库中,并且出现“缺少逗号”异常,但我看不到它的来历。
"insert into comandadvd values('" + txt_idComanda.Text + "','" +
txtFormat.Text + "','" + "', to_date('" + txtData.Text + "','DDMMYYY')'" + txtIdTipPlata.Text + "','" + txtPret.Text + "')";
另外,这是它的Oracle代码:
INSERT INTO ComandaDVD (Id_Comanda,Id_Format,Data_Comanda,Id_TipPlata,Pret)
VALUES ('1','1','12-11-2011','1','200');
提前致谢!
您to_date(
在查询中添加了多余的逗号。更正后的代码如下:
"INSERT INTO ComandaDVD (Id_Comanda,Id_Format,Data_Comanda,Id_TipPlata,Pret) VALUES (" +
"'" + txt_idComanda.Text + "', " +
"'" + txtFormat.Text + "', " +
"to_date('" + txtData.Text + "', 'DDMMYYY'), " +
"'" + txtIdTipPlata.Text + "', " +
"'" + txtPret.Text + "')";
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句