zoukankan      html  css  js  c++  java
  • DA中直接运行SQL命令,并返回影响行数

    1 、 客户端直接运行SQL命令 , 使用TDARemoteCommand
    2 、 服务器端直接运行SQL命令 , 使用TDALocalCommand

    function DeleteRowFromTable1(aID: integer): integer;
    var
      lCommand: TDALocalCommand;
      linp, lout: DataParameterArray;
      i: integer;
    begin
      try
        lCommand := TDALocalCommand.Create(nil);
        lCommand.ServiceName := 'MyService';
        linp := DataParameterArray.Create;
        try
          with linp.Add do
          begin
            Name := UTF8Encode('ID');
            Value := aID;
          end;
          lCommand.Execute('DeleteRow', linp, lout);
          if lout <> nil then
            for i := 0 to lout.Count - 1 do
              if UTF8ToString(lout[i].Name) = 'ErrorCode' then
                Result := lout[i].Value;
        finally
          linp.Free;
          lout.Free;
        end;
      finally
        lCommand.Destroy;
      end;
    end;
  • 相关阅读:
    第五周总结
    第四周总结
    关于“模仿"和”创新“
    第三周总结
    第九周总结
    第八周总结
    第六周总结
    中国历史上成功的两人合作
    第五周总结
    第四周总结
  • 原文地址:https://www.cnblogs.com/leonkin/p/3208676.html
Copyright © 2011-2022 走看看