SQLPrepare

Function

SQLPrepare prepares an SQL statement to be executed.

Prototype

1
2
3
SQLRETURN SQLPrepare(SQLHSTMT      StatementHandle,    
                     SQLCHAR       *StatementText,     
                     SQLINTEGER    TextLength);

Parameter

Table 1 SQLPrepare parameters

Keyword

Description

StatementHandle

Statement handle.

StatementText

SQL text string.

TextLength

Length of StatementText.

Return Values

Precautions

If SQLPrepare returns SQL_ERROR or SQL_SUCCESS_WITH_INFO, the application can then call SQLGetDiagRec, set HandleType and Handle to SQL_HANDLE_STMT and StatementHandle, and obtain the SQLSTATE value. The SQLSTATE value provides the detailed function calling information.

Examples

See Examples.