void __fastcall Prepare();
Prepares the SQL command for execution.
Call the Prepare method to prepare the SQL command for execution. It is not required to call Prepare for a standard SQL command before execution, because the first Execute / ExecSQL / Open call will automatically prepare the command. However, it is required for stored procedures if you need to automatically populate the Params collection. After the command is prepared, SQLText will return the SQL command text as it is sent to the DBMS.
To prepare the SQL command, a DBMS connection must be active; otherwise, an exception will be raised.
After Prepare is called, the application cannot change command parameter data types and sizes. Otherwise, during the next Execute / ExecSQL / ExecProc / Open call, an exception will be raised. It is recommended to setup parameters before the Prepare call.
FDQuery1.SQL.Text := 'select * from MyTab'; FDQuery1.Prepare;