Home How To Online Documentation Support Download Order
 

 

 

SACommand
SAConnection
SAException
SAField
SAParam

SAString
SADateTime
SANumeric
SAInterval

Enums and Typedefs

  

Usage

Class Members

Examples

SACommand::Cancel

void Cancel( );
throw (SAException);

Attempts to cancel the pending result set, or current statement execution. The exact definition is vendor-dependent.

Remarks

Cancel can cancel the following types of processing on a statement:

  • A function running asynchronously on the statement.
  • A function running on the statement on another thread.

After an application calls a function asynchronously, it checks  repeatedly to determine whether it has finished processing. While the function is processing, an application can call Cancel to cancel the function.

In a multithread application, the application can cancel a function that is running synchronously on a statement.

Server specific notes

DBMS client

Specific notes 

Oracle

SQLAPI++ calls obreak function with Oracle 7 (OCI7) to cancel a query. To get more details see obreak function description in Oracle documentation.

SQLAPI++ calls OCIBreak function with Oracle 8 (OCI8) to cancel a query. To get more details see OCIBreak function description in Oracle documentation.

SQL Server (ODBC)

SQLAPI++ calls SQLCancel function to cancel a query. To get more details see SQLCancel function description in SQL Server ODBC documentation.

SQL Server (OLE DB)

SQLAPI++ calls ICommand::Cancell function to cancel a query. To get more details see ICommand::Cancel function description in SQL Server OLE DB documentation.

SQL Server (DB-Library)

SQLAPI++ calls dbcancel function to cancel a query. To get more details see dbcancel function description in SQL Server documentation.
To enable cancellation you have to set command option "UseDataReadyLoopOnExecute" to "on".

Sybase

SQLAPI++ calls ct_cancel function.

DB2

SQLAPI++ calls SQLCancel function to cancel a query. To get more details see SQLCancel function description in DB2 documentation.

Informix

SQLAPI++ calls SQLCancel function to cancel a query. To get more details see SQLCancel function description in Informix documentation.

InterBase

Not supported.

SQLBase

SQLAPI++ calls sqlcan function to cancel a query. To get more details see sqlcan function description in SQLBase documentation.

MySQL

SQLAPI++ calls mysql_stmt_reset when the statement API used or tries to execute 'KILL QUERY N' command for version 5.0 and above. Otherwise it calls mysql_kill function to cancel a query, and then calls mysql_ping function to restore connection with server. To get more details see strong>mysql_stmt_reset, mysql_kill and mysql_ping functions description in MySQL documentation.

PostgreSQL

SQLAPI++ calls PQrequestCancel function to cancel a query. To get more details see PQrequestCancel function description in PostgreSQL documentation.

ODBC

SQLAPI++ calls SQLCancel function to cancel a query. To get more details see SQLCancel function description in ODBC documentation.

SQLite

SQLAPI++ calls sqlite3_interrupt function to cancel a query. To get more details see sqlite3_interrupt function description in SQLite documentation.

SQL Anywhere

SQLAPI++ calls sqlany_cancel function to cancel a query. To get more details see sqlany_cancel function description in SQL Anywhere documentation.

See also

Error handling

Problems and Questions

If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to howto@sqlapi.com.