Browse Source

sqliteds: + Add ExecSQL overload that takes as parameter a TStrings

git-svn-id: trunk@15133 -
blikblum 15 years ago
parent
commit
4842a5fd1c
1 changed files with 8 additions and 2 deletions
  1. 8 2
      packages/fcl-db/src/sqlite/customsqliteds.pas

+ 8 - 2
packages/fcl-db/src/sqlite/customsqliteds.pas

@@ -220,6 +220,7 @@ type
     procedure ExecCallback(const ASql: String; UserData: Pointer = nil);
     procedure ExecSQL;
     procedure ExecSQL(const ASql: String);
+    procedure ExecSQL(ASqlList: TStrings);
     procedure ExecSQLList;
     procedure ExecuteDirect(const ASql: String); virtual; abstract;
     function GetSQLValue(Values: PPChar; FieldIndex: Integer): String;
@@ -1515,15 +1516,20 @@ begin
   ExecuteDirect(ASQL);
 end;
 
-procedure TCustomSqliteDataset.ExecSQLList;
+procedure TCustomSqliteDataset.ExecSQL(ASqlList: TStrings);
 begin
   if FSqliteHandle = nil then
     GetSqliteHandle;
-  FReturnCode := SqliteExec(PChar(FSQLList.Text), nil, nil);
+  FReturnCode := SqliteExec(PChar(ASQLList.Text), nil, nil);
   if FReturnCode <> SQLITE_OK then
     DatabaseError(ReturnString, Self);
 end;
 
+procedure TCustomSqliteDataset.ExecSQLList;
+begin
+  ExecSQL(SQLList);
+end;
+
 function TCustomSqliteDataset.GetSQLValue(Values: PPChar; FieldIndex: Integer
   ): String;
 begin