My test code:DBXCommon.TDBXCommand.Prepare
Prepare the command for execution
This method prepares the command for execution.
If no parameters have been set up, the driver supports parameter metadata and the dynamic SQL statement contains parameters, Prepare sets up the command's parameters.
Code: Select all
procedure TForm2.Button1Click(Sender: TObject);
var
LCommand: TDBXCommand;
begin
LCommand := SQLConnection1.DBXConnection.CreateCommand;
LCommand.Text := 'SELECT * FROM employee WHERE empno = ?';
LCommand.Prepare;
Memo1.Lines.Add(IntToStr(LCommand.Parameters.Count));
end;
How to set the sqlcoonection.param what support auto create TDBXCommand.Parameters?