IBX.IBQuery.TIBQuery.Prepare

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Prepare;

C++

void __fastcall Prepare();

Properties

Type Visibility Source Unit Parent
procedure
function
public
IBX.IBQuery.pas
IBX.IBQuery.hpp
IBX.IBQuery TIBQuery

Description

Sends a query to the server for optimization prior to execution.

Call Prepare to have the remote database server allocate resources for the query and to perform additional optimizations. Calling Prepare before executing a query improves application performance.

A query is automatically prepared before being executed. A query that was automatically prepared will then be automatically unprepared after it executes. When a query will be executed a number of times, an application should always explicitly prepare the query to avoid multiple and unnecessary prepares and unprepares.

Preparing a query consumes some database resources, so it is good practice for an application to unprepare a query once it is done using it. The UnPrepare method unprepares a query.

Note: Interbase Express components automatically handle preparation of queries and keep them prepared for as long as it is advantageous. There is no need for the user to prepare queries manually when using Interbase Express.