FinalSql still has the non-Replaced Params.
Code: Select all
SELECT * FROM table WHERE x=:param.
:param='X';
Code: Select all
SELECT * FROM table WHERE x='X';
Code: Select all
SELECT * FROM table WHERE x=:param.
:param='X';
Code: Select all
SELECT * FROM table WHERE x='X';
Code: Select all
function GetFinalSQL(DataSet: TCustomDADataSet): string;
var
i: integer;
begin
result := '';
if not Assigned(DataSet) then exit;
Result:= DataSet.FinalSQL;
for i := 0 to DataSet.ParamCount -1 do
if DataSet.Params.IsNull then
Result:= StringReplace(Result,':'+DataSet.Params.Name, 'Null', [rfReplaceAll])
else
Result:= StringReplace(Result,':'+DataSet.Params.Name, DataSet.Params.Value, [rfReplaceAll])
end;