STATEMENTS

Populates a table of information on currently executing statements.

Returns table | Field | Type | | — | — | | id | bigint | | session_id | bigint | | sql_stmt | varchar(1024) | | create time | timestamp | | parameters | varchar(1024) |

Syntax

SELECT * FROM TABLE(SYS_BOOT.MGMT.STATEMENTS());

Note: As of version 6.0, you no longer need to use the preface SYS_BOOT.MGMT.

Example

SELECT * FROM TABLE(STATEMENTS());      
        
'ID','SESSION_ID','SQL_STMT','CREATE_TIME','PARAMETERS'
'4','3','INSERT INTO "SYS_BOOT"."MGMT"."ALL_TRACE"
(SELECT STREAM "EXPR$0"."ERROR_TIME", "EXPR$0"."ERROR_LEVEL", "EXPR$0"."IS_ERROR", "EXPR$0"."ERROR_CLASS", "EXPR$0"."ERROR_NAME", "EXPR$0"."SQL_STATE", "EXPR$0"."MESSAGE", "EXPR$0"."THREAD_ID", "EXPR$0"."SESSION_ID", "EXPR$0"."STATEMENT_ID", "EXPR$0"."GRAPH_ID", "EXPR$0"."NODE_ID", "EXPR$0"."XO_NAME", "EXPR$0"."ERROR_REPORTER", "EXPR$0"."ERROR_SQL", "EXPR$0"."ERROR_BACKTRACE", "EXPR$0"."DATA_ROWTIME", "EXPR$0"."DATA_ROW", "EXPR$0"."SOURCE_POSITION_KEY", "EXPR$0"."PUMP_DB", "EXPR$0"."PUMP_SCHEMA", "EXPR$0"."PUMP_NAME"
FROM STREAM(SPECIFIC "SYS_BOOT"."MGMT"."NAMEDERRORSTREAM"('GLOBAL_ERROR_STREAM')) AS "EXPR$0")','2019-04-08 01:00:26.472','[[]]'
'227','6','SELECT * FROM TABLE(STATEMENTS())','2019-05-02 14:39:39.78','[[]]'
2 rows selected (0.391 seconds)