FireDAC Components for Bugzilla

Build 21.0.7930

Prepared Statements

Executing Prepared Statements with FireDAC Classes

By default, TFDQuery prepares the query to avoid recompiling the same query over and over.

FDQuery1.SQL.Text := 'SELECT * FROM SampleTable_1 WHERE Column2=:Column2' 
FDQuery1.ParamByName('Column2').AsString := 'Bob';
FDQuery1.Open;

Notes

  • If you need to execute a command only once, set ResourceOptions.DirectExecute to true.
  • The connection must be active and open while a statement is prepared.

Copyright (c) 2021 CData Software, Inc. - All rights reserved.
Build 21.0.7930