Gets or sets command prepare for execution status.
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.
property Prepared: Boolean;
What do you think about this topic? Send feedback!