浏览代码

* TSQLStatement.RowsAffected

git-svn-id: trunk@24703 -
michael 12 年之前
父节点
当前提交
abe86dea9f
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      packages/fcl-db/src/sqldb/sqldb.pp

+ 9 - 0
packages/fcl-db/src/sqldb/sqldb.pp

@@ -255,6 +255,7 @@ type
     Procedure Execute;
     Procedure Execute;
     Procedure Unprepare;
     Procedure Unprepare;
     function ParamByName(Const AParamName : String) : TParam;
     function ParamByName(Const AParamName : String) : TParam;
+    function RowsAffected: TRowsCount; virtual;
     Property Prepared : boolean read GetPrepared;
     Property Prepared : boolean read GetPrepared;
   end;
   end;
 
 
@@ -828,6 +829,14 @@ begin
   Result:=FParams.ParamByName(AParamName);
   Result:=FParams.ParamByName(AParamName);
 end;
 end;
 
 
+function TCustomSQLStatement.RowsAffected: TRowsCount;
+begin
+  Result := -1;
+  if not Assigned(Database) then
+    Exit;
+  Result:=Database.RowsAffected(FCursor);
+end;
+
 { TSQLConnection }
 { TSQLConnection }
 
 
 function TSQLConnection.StrToStatementType(s : string) : TStatementType;
 function TSQLConnection.StrToStatementType(s : string) : TStatementType;