Browse Source

* TSQLStatement.RowsAffected

git-svn-id: trunk@24703 -
michael 12 years ago
parent
commit
abe86dea9f
1 changed files with 9 additions and 0 deletions
  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 Unprepare;
     function ParamByName(Const AParamName : String) : TParam;
+    function RowsAffected: TRowsCount; virtual;
     Property Prepared : boolean read GetPrepared;
   end;
 
@@ -828,6 +829,14 @@ begin
   Result:=FParams.ParamByName(AParamName);
 end;
 
+function TCustomSQLStatement.RowsAffected: TRowsCount;
+begin
+  Result := -1;
+  if not Assigned(Database) then
+    Exit;
+  Result:=Database.RowsAffected(FCursor);
+end;
+
 { TSQLConnection }
 
 function TSQLConnection.StrToStatementType(s : string) : TStatementType;