Previous Topic: Set Cursor ConcurrencyNext Topic: Execute the Query


Specify a Cursor Name

The application program must specify a cursor name or get a name generated by the driver.

SQLSetCursorName

The application uses this to specify an explicit cursor name. As an extension to the ODBC specification, this function sets the cursor concurrency to SQL_CONCUR_LOCK if needed. If the statement has already been prepared, it is prepared again to use the specified cursor name. If it has already been executed, an error is returned.

SQLGetCursorName

If the application has specified an explicit cursor name, this returns the application specified name. If the application has not specified a cursor name, this returns a name generated in accordance with the ODBC specification if cursor concurrency has been set to SQL_CONCUR_LOCK, and returns an error HY015 otherwise. This is according to the ODBC 2.x specification; an ODBC 3.x driver always returns a cursor name. This function can be called after the statement has been executed.