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

本文介绍了一段用于更新数据库中取票单信息的代码实现。该方法通过构建SQL更新语句并使用参数化查询的方式,根据传入的取票单对象属性动态设置更新字段,确保了数据更新的安全性和灵活性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

publicboolModifyDrawBill(MDrawBill mBill)

{

StringBuilder strSQLText=newStringBuilder();

strSQLText.Append("update DrawBill set");

OracleParameter[] param={newOracleParameter("PKID", OracleType.Int32),newOracleParameter("StationId", OracleType.VarChar),newOracleParameter("BillBegin", OracleType.VarChar),newOracleParameter("BillEnd", OracleType.VarChar),newOracleParameter("SumCount", OracleType.Int32),newOracleParameter("DrawDate", OracleType.DateTime),newOracleParameter("IsConfirm", OracleType.Int32),newOracleParameter("AppUser", OracleType.NVarChar),newOracleParameter("CheckUser", OracleType.NVarChar),newOracleParameter("Memo", OracleType.NVarChar)

};//@@lwd 20110803param[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");returnOracleHelper.ExecuteNonQuery(OracleHelper.Connection_String, CommandType.Text, strSQLText.ToString(), param)>0;//提示“RA-01036: 非法的变量名/编号” }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值