|
@@ -554,7 +554,8 @@ Type
|
|
|
|
|
|
{ TFPDDEngine }
|
|
|
TFPDDEngineCapability =(ecImport,ecCreateTable,ecViewTable, ecTableIndexes,
|
|
|
- ecRunQuery, ecRowsAffected, ecSequences, ecDomains);
|
|
|
+ ecRunQuery, ecRowsAffected, ecSequences, ecDomains,
|
|
|
+ ecParams);
|
|
|
TFPDDEngineCapabilities = set of TFPDDEngineCapability;
|
|
|
{
|
|
|
to avoid dependencies on GUI elements in the data dictionary engines,
|
|
@@ -598,7 +599,11 @@ Type
|
|
|
// Should not open the dataset.
|
|
|
Function ViewTable(Const TableName: String; DatasetOwner : TComponent) : TDataset; virtual;
|
|
|
// Run a non-select query. If possible, returns the number of modified records.
|
|
|
- Function RunQuery(SQL : String) : Integer; Virtual;
|
|
|
+ Function RunQuery(SQL : String) : Integer; Virtual; overload;
|
|
|
+ // Run a non-select query. If possible, apply parameters and returns the number of modified records.
|
|
|
+ Function RunQuery(SQL : String; Params : TParams) : Integer; virtual; overload;
|
|
|
+ // Apply parameters to a dataset, if possible
|
|
|
+ Procedure ApplyParams(DS : TDataset; Params : TParams); virtual;
|
|
|
// Create a select query TDataset. Do not open the resulting dataset.
|
|
|
Function CreateQuery(SQL : String; DatasetOwner : TComponent) : TDataset; Virtual;
|
|
|
// Assign a select query and open the resulting dataset.
|
|
@@ -761,6 +766,7 @@ Resourcestring
|
|
|
SErrViewTableNotSupported = 'Viewing tables is not supported by the "%s" engine.';
|
|
|
SErrRunQueryNotSupported = 'Running queries is not supported by the "%s" engine.';
|
|
|
SErrOpenQueryNotSupported = 'Running and opening SELECT queries is not supported by the "%s" engine.';
|
|
|
+ SErrApplyParamsNotSupported = 'Cannot apply parameters to a dataset in engine "%s".';
|
|
|
SErrSetQueryStatementNotSupported = 'Setting the SQL statement is not supported by the "%s" engine.';
|
|
|
SErrGetTableIndexDefsNotSupported = 'Getting index definitions of a table is not supported by the "%s" engine.';
|
|
|
SSavingFieldsFrom = 'Saving fields from %s';
|
|
@@ -2019,6 +2025,18 @@ begin
|
|
|
Raise EDataDict.CreateFmt(SErrRunQueryNotSupported,[DBType]);
|
|
|
end;
|
|
|
|
|
|
+function TFPDDEngine.RunQuery(SQL: String; Params: TParams): Integer;
|
|
|
+begin
|
|
|
+ if Assigned(Params) then
|
|
|
+ Raise EDataDict.CreateFmt(SErrApplyParamsNotSupported,[DBType]);
|
|
|
+ Result:=RunQuery(SQL);
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TFPDDEngine.ApplyParams(DS: TDataset; Params: TParams);
|
|
|
+begin
|
|
|
+ Raise EDataDict.CreateFmt(SErrApplyParamsNotSupported,[DBType]);
|
|
|
+end;
|
|
|
+
|
|
|
function TFPDDEngine.CreateQuery(SQL: String; DatasetOwner : TComponent): TDataset;
|
|
|
begin
|
|
|
Raise EDataDict.CreateFmt(SErrOpenQueryNotSupported,[DBType]);
|