这里是讨论delphi的,你说VB干什么
解决方案 »
- WebBrowser控件中遇到下载链接下载时如何自动点下载对话框中的保存按钮?
- delphi 一个Tquery中写多条SQL语句
- 使用IXMLDocument解析XML的问题???
- 请教画虚线
- 开发一个基于ActiveForm控件,然后放一个Timage组件。请问怎样增加自定义函数、过程。以及怎样使用Timage的函数和过程呢?
- 我想用progressbar显示增加和删除数据的速度,请问如何得知增加和删除的运行时间以便用progressbar显示
- pchar的用法
- 涉及到Database desktop创建的PARADOX表的程序在别的机器上不能够运行,请帮助!先谢了!
- 运行之前用Delphi编写的程序出现乱码。
- 请Crob再指教关于图片保存的问题(也请其它高手赐教)
- 如何使用chm帮助文件?
- 还是FindFirst、FindNext问题!!!
for
select qc,rev,send,bal from a
For Update Of qc <---------这是什么意思?!去掉它
open youbiao---the end.
for
select qc,rev,send,bal from a
For Update Of qc <---------这是什么意思?!去掉它
open youbiao---the end.
declare @b decimal(6,2)
declare @qc decimal(6,2)
declare @rev decimal(6,2)
declare @send decimal(6,2)
declare @bal decimal(6,2)
declare @flag int
declare youbiao scroll cursor
for
select qc,rev,send,bal from a
For Update Of bal,qc
open youbiao
FETCH NEXT FROM youbiao INTO @qc,@rev,@send,@bal
set @flag=0
WHILE @@FETCH_STATUS=0
BEGIN
if @flag=0
begin
set @flag=1
end else
begin
update a set qc=@a
where current of youbiao
end
update a
set bal=qc+rev-send,
@a=qc+@rev-@send
where current of youbiao
FETCH NEXT FROM youbiao INTO @qc,@rev,@send,@bal
END
CLOSE youbiao
DEALLOCATE youbiao
在 READ ONLY 游标上不能指定 FOR UPDATE。
我该怎么办呢?:( :(
declare @rev decimal(6,2);
declare @send decimal(6,2);
declare @bal decimal(6,2);
Declare @tmp decimal(6,2);declare youbiao cursor for select qc,rev,send,bal from a For update of qc,bal;
open youbiao;
FETCH NEXT FROM youbiao INTO @qc,@rev,@send,@bal;
Set @tmp=@qc+@rev-@send;
If (@@FETCH_STATUS =0)
Update a Set bal=@qc+@rev-@send Where current of youbiao;FETCH NEXT FROM youbiao INTO @qc,@rev,@send,@bal;
WHILE (@@FETCH_STATUS =0)
BEGIN
Update a Set qc=@tmp,bal=@rev-@send+@tmp Where current of youbiao;
Set @tmp=@tmp+@rev-@send;
FETCH NEXT FROM youbiao INTO @qc,@rev,@send,@bal;
END;CLOSE youbiao;
DEALLOCATE youbiao;