RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSQLQuery.PrepareStatement Method

Prepares the query for execution.

Pascal
procedure PrepareStatement; override;
C++
virtual __fastcall PrepareStatement();

PrepareStatement performs most of the necessary tasks for preparing a query to be executed on the server. It ensures the dbExpress and the database server have allocated any resources they need for executing the query and binding its parameters. Any named parameters are temporarily converted to unnamed parameters because dbExpress does not support named parameters. 

Do not call PrepareStatement when preparing a query for execution. Instead, set the Prepared property to true. When you use the Prepared property instead, the query keeps track of the fact that it has already been prepared and need not repeat the process every time it executes the query. In addition, when you set the Prepared property, the query initializes internal properties that keep track of the number of rows affected by the query. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!