with query2 do
  begin
    close;
    sql.clear;
    Params.clear;
    sql.add(' Update SYSFUNC Set FLAG=:iflag where FUNC_CODE in ( select FUNC_CODE   ');
    sql.add(' from SYSUSERFUNC where CUSERID=:icUserID  ) ');
    parambyName('iflag').asString:='1';
    ParambyName('icUserID').asString:=UserID;
    prepare;
    ExecSql;
  end;
  str:='select func_code ,flag from sysfunc ';
  wrymain.openquery(query2,str);
  with query2 do begin
     first;
     while not eof do begin
       writeln(f,fieldbyname('flag').asstring+fieldbyname('func_code').asstring);
       next;
     end;  end;   
 写到文件中的数据没有改变,这是为什么,我怎么去解决?

解决方案 »

  1.   

    这个是这行语句
    前一般不用post方法
      

  2.   

    你的where 条件是不是可以查找的记录阿?我也出现这样的问题了只要把条件限制修改就行了
      

  3.   

    sql.add(' Update SYSFUNC Set FLAG=:iflag where FUNC_CODE in ( select FUNC_CODE   ');
        sql.add(' from SYSUSERFUNC where CUSERID=:icUserID  ) ');
        
    这句有问题
      

  4.   

    先用Select试一下,where对不对。
      

  5.   

    最大的可能是 FUNC_CODE in ( select FUNC_CODE   ');
        sql.add(' from SYSUSERFUNC where CUSERID=:icUserID  ) ');条件不成立;
    楼主应该用查询分析器,调试一下select FUNC_CODE  
    from SYSUSERFUNC where CUSERID=:icUserID 是否有数据?能不能满足
    where FUNC_CODE in 
    的条件?