SQL_PrepareQuery Function

Creates a new prepared statement query. Prepared statements can be executed any number of times. They can also have placeholder parameters, similar to variables, which can be bound safely and securely (for example, you do not need to quote bound strings).

Statement handles will work in any function that accepts a Query handle.

DBStatement SQL_PrepareQuery(Handle database, const char[] query, char[] error, int maxlength)


Handle database

A database Handle.

const char[] query

Query string.

char[] error

Error buffer.

int maxlength

Maximum size of the error buffer.

Return Value

A new statement Handle on success, INVALID_HANDLE otherwise. The Handle must be freed with CloseHandle().


Invalid database Handle.