请各位帮忙解答问题,asp程序,-------------急

yrj1210 2005-10-18 10:21:29
我现在有一个程序,一个客户222购买商品,我有一个临时表a,
序号,num,order_num,money
1,222,5445,230。00
2,222,44334,288。00
3,222,5445,494。00
购买商品后
insert into a (num,order_num,money) values ('222','2344','500.00')
页面要判断同一会员号的money是否超过1200,如果超过就要把他的每笔记录都要insert到其他表中bb中(就是4比记录都insert到bb中)
请问应该怎么写,请帖出代码,谢谢
...全文
138 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
yrj1210 2005-10-18
  • 打赏
  • 举报
回复
请各位帮忙啊
这几天真的急死我了
yrj1210 2005-10-18
  • 打赏
  • 举报
回复
bb的数据结构是id(自动),b_num(读取其他表中得来),order_no,num,money,log_date(自动)

asp程序和存储过程怎么写?也请贴出来,谢谢
IT_Fish 2005-10-18
  • 打赏
  • 举报
回复
建议是用存储进程了,这样好点
zykj_2000 2005-10-18
  • 打赏
  • 举报
回复
bb的数据结构是怎么样的
yrj1210 2005-10-18
  • 打赏
  • 举报
回复
我用的数据库是SQL数据库,因为bb和a 的数据结构不是一样的
sql=" if (select sum(money) from a where num='222')>1200"
sql=sql&" insert into bb select * from a where num='222'"

这样写在程序里或者存储过程里可以吗?
sdts 2005-10-18
  • 打赏
  • 举报
回复
sql=" if (select sum(money) from a where num='222')>1200"
sql=sql&" insert into bb select * from a where num='222'"

如果是sql server 2000 就执行这个sql 不知道access行不行 如果不行就把逻辑放到asp里
zykj_2000 2005-10-18
  • 打赏
  • 举报
回复
if (select sum(money) from a where num=222)>1200
begin
insert into b(num,order_num,money) select num,order_num,money from a where num=222
end

只能在存储过程中用
yrj1210 2005-10-18
  • 打赏
  • 举报
回复
怎么没有人回答啊,急死了
超级大笨狼 2005-10-18
  • 打赏
  • 举报
回复
zykj_2000(向MVP努力)已经回答的很好了,你具体问题出在哪里?
叶面制作?

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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