1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
function makeWhere( lField, lValue: variant):string;
var I: integer;
begin
if not VarIsArray(lField) or not VarIsArray(lValue)
or (VarArrayHighBound(lField,1) <> VarArrayHighBound(lValue,1))
then exit;
Result := 'Where ';
for I := VarArrayLowBound(lField,1) to VarArrayHighBound(lField,1) do
begin
Result := Result + varToStr(VarArrayGet(lField,[i])) + '='
+ quotedStr(varToStr(VarArrayGet(lValue,[i])));
if (I >= VarArrayLowBound(lField,1)) and (I < VarArrayHighBound(lField,1))
then Result := Result + ' AND '
else Result := Result + ' ';
end;
end; |