Firebird 2.5 Language Reference → Firebird 2.5 Language Reference → Monitoring Tables → MON$STATEMENTS |
Table of Contents
MON$STATEMENTS displays statements prepared for execution.
Column Name | Data Type | Description | |||
---|---|---|---|---|---|
MON$STATEMENT_ID | INTEGER | Statement identifier | |||
MON$ATTACHMENT_ID | INTEGER | Connection identifier | |||
MON$TRANSACTION_ID | INTEGER | Transaction identifier | |||
MON$STATE | SMALLINT | Statement state:
|
|||
MON$TIMESTAMP | TIMESTAMP | The date and time when the statement was prepared | |||
MON$SQL_TEXT | BLOB TEXT | Statement text in SQL | |||
MON$STAT_ID | INTEGER | 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.
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.
Notes | |
---|---|
|
Example: Cancelling all active queries for the specified connection:
DELETE FROM MON$STATEMENTS WHERE MON$ATTACHMENT_ID = 32
Firebird 2.5 Language Reference → Firebird 2.5 Language Reference → Monitoring Tables → MON$STATEMENTS |