SQLPREPARE( ) Function

Prepares a SQL statement for remote execution by SQLEXEC( ).

SQLPREPARE(nStatementHandle, cSQLCommand, [cCursorName])



Specifies the statement handle to the data source returned by SQLCONNECT( ).


Specifies the SQL statement passed to the data source.

The SQL statement can contain a parameterized WHERE clause, which creates a parameterized view. All parameters in the WHERE clause must be defined before SQLPREPARE( ) is issued. For example, if the parameters are variables, the variables must be created and initialized before SQLPREPARE( ) is issued. For more information about parameterized views, see How to: Create Parameterized Views.


Specifies the name of the Visual FoxPro cursor to which the result set is sent. If you don't include a cursor name, Visual FoxPro uses the default name SQLRESULT.

For multiple result sets, new cursor names are derived by appending an incremented number to the name of the first cursor.

Expand imageReturn Value

Expand imageRemarks

Expand imageExample

Expand imageSee Also

© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic