Page 1 of 1

Extend IZStatement by GetBatch

Posted: 15.01.2009, 14:38
by artelogic
Suggestion to extend 'IZStatement' with 'function GetBatch: TStringList;', so that you can fill the Batch by 'GetBatch.Text:=MyString;' instead of splitting MyString and calling subsequently 'AddBatch(SplitString);' and, of course, to implement it in TZAbstractStatement.



unit ZDbcIntfs;

[...]

IZStatement = interface(IZInterface)
['{22CEFA7E-6A6D-48EC-BB9B-EE66056E90F1}']

[...]

procedure AddBatch(const SQL: string);
procedure ClearBatch;
function ExecuteBatch: TIntegerDynArray;
function GetBatch: TStrings; // <--

[...]

end;

[...]

end.




unit ZDbcStatement;

[...]

TZAbstractStatement = class(TInterfacedObject, IZStatement)

[...]

public

[...]

procedure AddBatch(const SQL: string); virtual;
procedure ClearBatch; virtual;
function ExecuteBatch: TIntegerDynArray; virtual;
function GetBatch: TStrings; virtual; // <--

[...]

end;


implementation

[...]

function TZAbstractStatement.GetBatch: TStrings;
begin
Result := FBatchQueries;
end;

[...]

end.