代码分析:
procedure TfrmOPSFM942.ProcessYearEndBal;
begin
  FYStart := FYStart+'/'+IntTostr(FY);
  FYEnd := FYEnd+'/'+IntToStr(FY+FOffSet);
  if edChecked.text = '1' then begin
    with qryLocal, qryLocal.SQL do begin
      Close;
      Clear;
      Add('insert into END_BAL_AP');
      Add('(FY, supplier, amount)');
      Add('select '+IntToStr(FY)+', P.company, decode(B.amount,null,0,B.amount)+P.credit-P.debit');
      Add('from end_bal_ap B,');
      Add('     (select C.company, decode(sum(A.debitamt),null,0, sum(A.debitamt)) DEBIT,');
      Add('      decode(sum(A.crdtamt),null,0,sum(A.crdtamt)) CREDIT');
      Add('      from acctpay A, company C');
      Add('      where A.aptdt(+) >= to_date('''+FYStart+''','''+OPS_DATEFORMAT+''') and');
      Add('            A.aptdt(+) <= to_date('''+FYend+''','''+OPS_DATEFORMAT+''') and');
      Add('            C.company = A.company(+) and C.supplier = ''T''');
      Add('group by c.company) P');
      Add('where P.company = B.supplier(+) and B.FY(+) = '+IntToStr(FY-1));
      ExecSQL;
    end
  end
1. if edChecked.text = '1' then begin 
此处为何用 ‘1’ 来判断?2. ExecSQL 
A. 写入数据库,为何在后台 ORACLE8.16数据库中不会立即显示? 
B. 它有没有真正写到数据库? 
C. 而用post 就可立即在数据库中显示? 

解决方案 »

  1.   

    最好有你的函数执行目的说明,
    edChecked是什么类型的?
    执行ExecSQL之后不立即显示有缓存的因素在内,在这之后执行一次UpdateBatch(arAll)就ok
    了。
      

  2.   

    to  micher_yan(小学没毕业)
      
      小学没毕业 就来搞编程,佩服!
       
     "edChecked是什么类型的?
     执行ExecSQL之后不立即显示有缓存的因素在内
     在这之后执行一次UpdateBatch(arAll)就ok" 1. edChecked : TEdit;
     2. UpdateBatch(arAll)是  qryLocal:TQuery) 的方法?    
      

  3.   

    这里的edChecked是TEdit类型,而不上你理解的TCheckBox类型至于不立即显示的问题可能像楼上说的那样有缓存因素吧,不太清楚!