E.8. MON$STATEMENTS
MON$STATEMENTS
displays statements prepared for execution.
Column Name | Data Type | Description |
---|---|---|
|
| Statement identifier |
|
| Connection identifier |
|
| Transaction identifier |
|
| Statement state:
|
|
| The date and time when the statement was prepared |
|
| Statement text in SQL |
|
| Statistics identifier |
The STALLED state indicates that, at the time of the snapshot, the statement had an open cursor and was waiting for the client to resume fetching rows.
E.8.1. Using MON$STATEMENTS
to Cancel a Query
Monitoring tables are read-only.
However, the server has a built-in mechanism for deleting (and only deleting) records in the MON$STATEMENTS
table, which makes it possible to cancel a running query.
If no statements are currently being executed in the connection, any attempt to cancel queries will not proceed
After a query is cancelled, calling execute/fetch API functions will return an error with the
isc_cancelled
codeSubsequent queries from this connection will proceed as normal
ExampleCancelling all active queries for the specified connection:
|DELETE FROM MON$STATEMENTS
|WHERE MON$ATTACHMENT_ID = 32