FireDAC.Comp.Client.TFDCustomCommand.Prepared
Delphi
property Prepared: Boolean read GetPrepared write SetPrepared stored IsPS default False;
C++
__property bool Prepared = {read=GetPrepared, write=SetPrepared, stored=IsPS, default=0};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | public | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCustomCommand |
Description
Gets or sets the command for execution status.
Set Prepared to True to prepare the SQL command for execution. After that, the State is csPrepared
. Setting Prepared to True, calls the Prepare method. It is not required to set Prepared to True for a standard SQL command before execution, because the first Execute / Open call automatically prepares the command. Instead, it is required for the stored procedures, if you need to automatically populate the Params collection. After the command is prepared, SQLText returns the SQL command's text as it is sent to the DBMS.
To prepare the SQL command, the DBMS connection must be active, otherwise an exception is raised.
After the preparation of the SQL command, the application cannot change the command parameter's data types and sizes, otherwise at the next call of Execute or Open an exception is raised. So, set up the parameters before setting Prepared to True.
Set Prepared to False to unprepare the SQL command and release all its resources. After that, State becomes csInactive
. Setting Prepared to False, calls the Unprepare method.