Extend IZStatement by GetBatch

Code samples and contributions from users for ZeosLib's DBOs of version 6.x

Moderators: gto, cipto_kh, EgonHugeist, mdaems

artelogic
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 26.12.2008, 21:19

Extend IZStatement by GetBatch

Postby artelogic » 15.01.2009, 14:38

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.

Return to “User Contributions”

Who is online

Users browsing this forum: No registered users and 1 guest