Code: Select all
function kZConnection.GetTable(inTableName: string):kZTable;
var
ResultIndex: Integer;
begin
result:=Nil;
for ResultIndex:=0 to Pred(FDatasets.Count) do
if Assigned(FDataSets[ResultIndex]) and (Tobject(FDataSets[ResultIndex]) is tzTable) and
SameText(tzTable(FDataSets[ResultIndex]).TableName,inTableName) then
begin
result:=kZTable(FDataSets[ResultIndex]);
exit;
end;
end;
The Second function I'm struggling with was one that took an SQL String and returned a TObjectList of all the tables affected by an UPDATE, INSERT OR DELETE. I had used some tokenizer functions in V7.2.x but the tokenizer functions in Version 8 have changed so much I'm not even sure where to start.
Code: Select all
type
tzTableList = TObjectList<tzTables>;
function kzConnection.FindAllTablesAffectedBySQL(const InSQL:String);tzTableList;