这里是讨论delphi的,你说VB干什么

解决方案 »

  1.   

    这里是讨论delphi的,你说VB干什么
      

  2.   

    declare youbiao scroll cursor
    for
      select qc,rev,send,bal from a  
    For Update Of qc <---------这是什么意思?!去掉它
      open youbiao---the end.
      

  3.   

    declare youbiao scroll cursor
    for
      select qc,rev,send,bal from a  
    For Update Of qc <---------这是什么意思?!去掉它
      open youbiao---the end.
      

  4.   

    大哥,即使把 for update of qc 参数去掉也没用,我估计肯能是语句的问题。
      

  5.   

    declare @a decimal(6,2)
    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
      

  6.   

    大哥:系统一直提示:
    在 READ ONLY 游标上不能指定 FOR UPDATE。
    我该怎么办呢?:( :(
      

  7.   

    declare @qc decimal(6,2);
    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;