NexusDB preserves the execution context of an SQL statement if a prepared statement is requested by the client application, and stays prepared until explicitly unprepared. A prepared statement can therefore be reused without the overhead of creating a new execution context every time the statement is executed.
Usage
Prepared statements are typically used in combination with parameters, which is an efficient method for reusing data manipulation statements that are frequently used. For example, instead of executing a batch of UPDATE statements with explicit values, it is more efficient to prepare a parameterized UPDATE statement and provide the parameter values before each execution.
Examples
SELECT statement with parameters in the search condition
INSERT statement with parameters in the VALUES clause