Myquery.sql.text with params
Posted: Wed 12 Nov 2014 02:24
Is there a property that returns me the text of a query with the values of the parameters? How in the example below
Thank you
Example
MyQuery1.SQL.Text := 'insert into bloqueos values(:one,:two,:tree)';
MyQuery1.ParamByName('one').AsString := 'John';
MyQuery1.ParamByName('two').AsString := 'Peter';
MyQuery1.ParamByName('tree').AsInteger := 3;
Cad := MyQuery1.SQL.Text;
For i := 0 to MyQuery1.ParamCount-1 do
Cad := StringReplace(Cad,':'+MyQuery1.Params.Items.Name,MyQuery1.Params.Items.Value,[rfReplaceAll]);
ShowMessage(cad);
Thank you
Example
MyQuery1.SQL.Text := 'insert into bloqueos values(:one,:two,:tree)';
MyQuery1.ParamByName('one').AsString := 'John';
MyQuery1.ParamByName('two').AsString := 'Peter';
MyQuery1.ParamByName('tree').AsInteger := 3;
Cad := MyQuery1.SQL.Text;
For i := 0 to MyQuery1.ParamCount-1 do
Cad := StringReplace(Cad,':'+MyQuery1.Params.Items.Name,MyQuery1.Params.Items.Value,[rfReplaceAll]);
ShowMessage(cad);