请问这段话那里写错了?

yongmei123 2007-04-30 03:31:28
ls_sql="if exists(select * from kcckye where kcckye_kjnd="+ls_kjnd+" and kcckye_kjqj="+ls_kjqj+" and kcckye_ckbh="+ls_ckbh+""+&
"and kcckye_wlbh="+ls_wlbh+") update kcckye set kcckye_jslj= kcckye_jslj+li_sl,kcckye_jfsl=kcckye_jfsl+li_sl "+&
"where (kcckye_kjnd=:ls_kjnd and kcckye_kjqj=:ls_kjqj and kcckye_ckbh=:ls_ckbh and kcckye_wlbh=:ls_wlbh) "+&
"else insert into kcckye(kcckye_kjnd,kcckye_kjqj,kcckye_ckbh,kcckye_wlbh,kcckye_jslj,kcckye_jfsl)values("+ls_kjnd+","+ls_kjqj+","+ls_ckbh+","+ls_wlbh+",'+li_sl+','+li_sl+')"
...全文
414 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
meiZiNick 2008-05-01
  • 打赏
  • 举报
回复
关注 接分
knowledge_Is_Life 2008-05-01
  • 打赏
  • 举报
回复
有点难度哦
WDBOY0000 2007-05-08
  • 打赏
  • 举报
回复
ls_sql="if exists(select * from kcckye where kcckye_kjnd='"+ls_kjnd+"' and kcckye_kjqj='"+ls_kjqj+"' and kcckye_ckbh='"+ls_ckbh+"'"+&
"and kcckye_wlbh='"+ls_wlbh+"') update kcckye set kcckye_jslj= kcckye_jslj+"+string(li_sl)+",kcckye_jfsl=kcckye_jfsl+"+string(li_sl)+" "+&
"where (kcckye_kjnd='"+ls_kjnd+"' and kcckye_kjqj='"+ls_kjqj+"' and kcckye_ckbh='"+ls_ckbh+"' and kcckye_wlbh='"+ls_wlbh+"') "+&
"else insert into kcckye(kcckye_kjnd,kcckye_kjqj,kcckye_ckbh,kcckye_wlbh,kcckye_jslj,kcckye_jfsl)values('"+ls_kjnd+"','"+ls_kjqj+"','"+ls_ckbh+"','"+ls_wlbh+"',"+string(li_sl)+","+string(li_sl)+")"

错误已经给你修改 自己看吧!
AFIC 2007-05-08
  • 打赏
  • 举报
回复
错误好多阿,你最后把ls_sql的结果弄出来,慢慢改把
gsjack 2007-05-08
  • 打赏
  • 举报
回复
="+ls_kjnd+" 应为 ='"+ls_kjnd+" ' 依此类推
mrcheng86 2007-05-08
  • 打赏
  • 举报
回复
sql中拼入字符类型变量,要记得加单引号

kcckye_kjnd="+ls_kjnd+" and
kcckye_kjnd='"+ls_kjnd+"' and
lzheng2001 2007-05-08
  • 打赏
  • 举报
回复
把ls_sql的值取出来(比如放到text控件上), 然后放到数据库中分析运行.
OracleRoob 2007-05-06
  • 打赏
  • 举报
回复
格式不好。

中断代码,把SQL调试出来,直接到数据库中执行试试。
jdsnhan 2007-05-06
  • 打赏
  • 举报
回复
太乱,不好分析,把messagebox的结果放到数据库中执行,就很好查证错误所在了。
Methodor 2007-05-01
  • 打赏
  • 举报
回复
只看第1行,后面没看
第一行错误:
ls_sql="if exists(select * from kcckye where kcckye_kjnd="+ls_kjnd+" and ...

应该是:
ls_sql="if exists(select * from kcckye where kcckye_kjnd='"+ls_kjnd+"' and ...
junval 2007-04-30
  • 打赏
  • 举报
回复
太乱了
huangxinru 2007-04-30
  • 打赏
  • 举报
回复
什么错误?似乎""应为" "?

752

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧