Requests cancellation of an executing SQL statement.
SQLCANCEL(В ) cancels the execution of SQLCOLUMNS(В ), SQLEXEC(В ), SQLMORERESULTS(В ), and SQLTABLES(В ) in asynchronous mode. To establish asynchronous mode, use the SQLSETPROP(В ) function.
- Specifies the active statement handle whose SQL statement is to be canceled.
Numeric. SQLCANCEL(В ) returns 1 if the SQL statement is successfully canceled, вЂ“ 1 if there is a connection level error, and вЂ“ 2 if there is an environment level error.
The following example assumes SQLCONNECT(В ) is successfully issued, and its return value is stored to a memory variable named
SQLEXEC(В ) is used to sends a SQL statement to the data source and return the results to a cursor. SQLCANCEL(В ) is issued to stop the query.
= SQLSETPROP(gnHandle, 'asynchronous', .T.) && To stop SQLEXEC( ) = SQLEXEC(gnHandle, 'SELECT * FROM authors') = SQLCANCEL(gnHandle) && Wrong select statement, cancel