为什么在SQL查询器和asp记录集里得到的结果不一样?是不是提交的语句太多,两个循环

yaodayizi 2006-08-23 01:52:03

for k=0 to ubound(taskIdArray)
for i=0 to ubound(idxArray)

sqlx="select id,taskType from task where assignUserid like '%"&idxArray(i)&",%' and state not in (3,4) and id ="&taskIdArray(k)

set rsx=conn.execute(sqlx)
startSql1=""
startSql2=""
if not rsx.eof then

do while not rsx.eof
startSql1="update task set state=3,startTime='"&now()&"' where id="&rsx("id")
'startSql12="update taskGroup set state=3,startTime='"&now()&"' where id="&rs("id")
startSql3="update taskEmployee set state=3,startTime='"&now()&"' where fid=0 and id="&rsx("id")
conn.execute(startSql1)
'conn.execute(startSql3)
'info="系统自动设置ID为 "&taskIdArray(i)&" 的工作计划状态为进行中"
'recordAdd "设置状态",rsx("id"),"task",3,"task",info
response.write rsx("id")&" taskName= "&rsx("taskType")&"<br>"&startsql1&"<br>"&startsql3&"<br>"
rsx.movenext
loop
end if
rsx.close
set rsx=nothing
'response.write rsx("id")
next
next
...全文
250 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
longli67 2006-08-23
  • 打赏
  • 举报
回复
你在程序中response.write(sql)出来和分析器里对比一下你的语句,估计问题就找出来了!
yaodayizi 2006-08-23
  • 打赏
  • 举报
回复
这里是生成的语句
select id,taskType from task where assignUserid like '%2,%' and state not in (3,4) and id =3
False
False
3 taskName= 页面版式修改
update task set state=3,startTime='2006-8-23 1:42:54' where id=3
update taskEmployee set state=3,startTime='2006-8-23 1:42:54' where fid=0 and id=3

select id,taskType from task where assignUserid like '%2,%' and state not in (3,4) and id =4
False
False
4 taskName= 普通图片修改
update task set state=3,startTime='2006-8-23 1:42:54' where id=4
update taskEmployee set state=3,startTime='2006-8-23 1:42:54' where fid=0 and id=4

27,581

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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