AnyDAC
ContentsIndexHome
PreviousUpNext
TADCustomCommand.Prepared Property

Gets or sets command prepare for execution status.

Group
Links

Set Prepared to True to prepare SQL command for execution. After that the State = csPrepared. Setting Prepared to True, will call Prepare method. It is not required to set Prepared to True for standard SQL command before execution, because first Execute / Open call will automatically prepare command. But it is required for stored procedures, if you need to automatically populate Params collection. After command is prepared, SQLText will return SQL command text as it is sent to the DBMS. 

To prepare SQL command DBMS connection must be active, otherwise an exception will be raised. 

After SQL command preparation application cannot change command parameter data types and sizes, otherwise on next Execute or Open call an exception will be raised. So, setup parameters before setting Prepared to True. 

Set Prepared to False to unprepare SQL command and release all it resources. After that State = csInactive. Setting Prepared to False, will call Unprepare method.

property Prepared: Boolean;
What do you think about this topic? Send feedback!