首页 新闻 会员 周边 捐助

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

0
悬赏园豆:5 [已解决问题] 解决于 2012-07-25 16:23
public bool ModifyDrawBill(MDrawBill mBill)
{
StringBuilder strSQLText
= new StringBuilder();
strSQLText.Append(
"update DrawBill set ");
OracleParameter[] param
=
{
new OracleParameter("PKID", OracleType.Int32),
new OracleParameter("StationId", OracleType.VarChar),
new OracleParameter("BillBegin", OracleType.VarChar),
new OracleParameter("BillEnd", OracleType.VarChar),
new OracleParameter("SumCount", OracleType.Int32),
new OracleParameter("DrawDate", OracleType.DateTime),
new OracleParameter("IsConfirm", OracleType.Int32),
new OracleParameter("AppUser", OracleType.NVarChar),
new OracleParameter("CheckUser", OracleType.NVarChar),
new OracleParameter("Memo", OracleType.NVarChar)
};
//@@lwd 20110803
param[0].Value = mBill.PKID;
if (mBill.StationId != null)
{
strSQLText.Append(
"StationId=:StationId,");
param[
1].Value = mBill.StationId;
}
if (mBill.BillBegin != null)
{
strSQLText.Append(
"BillBegin=:BillBegin,");
param[
2].Value = mBill.BillBegin;
}
if (mBill.BillEnd != null)
{
strSQLText.Append(
"BillEnd=:BillEnd,");
param[
3].Value = mBill.BillEnd;
}
if (mBill.SumCount != null)
{
strSQLText.Append(
"SumCount=:SumCount,");
param[
4].Value = mBill.SumCount;
}
if (mBill.DrawDate != null)
{
strSQLText.Append(
"DrawDate=:DrawDate,");
param[
5].Value = mBill.DrawDate;
}
if (mBill.IsConfirm != null)
{
strSQLText.Append(
"IsConfirm=:IsConfirm,");
param[
6].Value = mBill.IsConfirm;
}
if (mBill.AppUser != null)
{
strSQLText.Append(
"AppUser=:AppUser,");
param[
7].Value = mBill.AppUser;
}
if (mBill.CheckUser != null)
{
strSQLText.Append(
"CheckUser=:CheckUser,");
param[
8].Value = mBill.CheckUser;
}
if (mBill.Memo != null)
{
strSQLText.Append(
"Memo=:Memo,");
param[
9].Value = mBill.Memo;
}
if (strSQLText.ToString().EndsWith(","))
{
strSQLText
= strSQLText.Remove(strSQLText.ToString().Length - 1, 1);

}
strSQLText.Append(
" where PKID=:PKID ");
return OracleHelper.ExecuteNonQuery(OracleHelper.Connection_String, CommandType.Text, strSQLText.ToString(), param) > 0;//提示“RA-01036: 非法的变量名/编号” }
Alec-Yin的主页 Alec-Yin | 初学一级 | 园豆:188
提问于:2011-08-30 14:53
< >
分享
最佳答案
0

有关键字?我记得用mvc+ef+mysql做一个网站的时候,怎么都不让添加,后来sql直接放到客户端里面,还是报错,最后才知道其中一个列名叫location,mysql貌似是关键字。。。

收获园豆:5
顾晓北 | 专家六级 |园豆:10898 | 2011-08-30 22:11
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册