![]() |
|
The sqlbreak() function sends the database server a request to interrupt processing of the current SQL request. You generally call this function to interrupt long queries.
The sqlbreak() function sends the interrupt request to the database server of the current connection. When the database server receives this request, it must determine if the SQL request is interruptible. Some types of database operations are not interruptible and others cannot be interrupted at certain points. You can interrupt the following SQL statements.
If the SQL request can be interrupted, the database server takes the following actions:
When the application regains control after an interrupted SQL request, any resources that are allocated to the SQL statement remain allocated. Any open databases, cursors, and transactions remain open. Any system-descriptor areas or sqlda structures remain allocated. The application program is responsible for the graceful termination of the program; it must release resources and roll back the current transaction.
While the database server executes an SQL request, the application is blocked, waiting for results from the database server. To call sqlbreak(), you must first set up some mechanism to unblock the application process. Two possible methods follow:
Before your program calls sqlbreak(), verify with the sqldone() function that the database server is currently processing an SQL request.