Skip to main content

INFORMATION.SCHEMA.CURRENTSTATEMENTS

persistent class INFORMATION.SCHEMA.CURRENTSTATEMENTS extends %Library.Persistent, %XML.Adaptor

SQL Table Name: INFORMATION_SCHEMA.CURRENT_STATEMENTS

Returns one row for each metadata string pushed onto the Application Metadata Stack (AMS) that belongs to the SQL application (ApplicationID="%SQL" [WHERE "%SQL"=$$$AMSApplicationIDSQL]).

The GetStackInfo() method within the %SYS.AppMetadataStack.SQL class returns the data ResultSet for this class/table.

Property Inventory

Method Inventory

Parameters

parameter READONLY = 1;
Inherited description: READONLY = 1 means that objects can be created, opened but not saved or deleted. Tables are projected to SQL as READONLY.

Properties

property AppMetadataStackID as %List;

MRP1317

The first $LIST(...) element of the Application Metadata Stack's (AMS) metadata string, which is itself a $LIST(...) string that is comprised of two or more elements that can be used to uniquely identify the metadata string of the application that pushed this information onto the AMS
Property methods: AppMetadataStackIDGet(), AppMetadataStackIDIsValid(), AppMetadataStackIDLogicalToOdbc(), AppMetadataStackIDLogicalToXSD(), AppMetadataStackIDOdbcToLogical(), AppMetadataStackIDSet(), AppMetadataStackIDXSDToLogical()
property CachedQuery as %String;
Name of the Cached Query class created for this SQL Statement NOTE: For some Embedded SQL DDL Statements, this will be the name of the Class/Routine in which the Embedded SQL DDL Statement is specified and code generated
Property methods: CachedQueryDisplayToLogical(), CachedQueryGet(), CachedQueryIsValid(), CachedQueryLogicalToDisplay(), CachedQueryLogicalToOdbc(), CachedQueryNormalize(), CachedQuerySet()
property CallerName as %String;
Name of the Routine/Class who called this SQL Statement If this is the top-most SQL Statement, then this value will be the empty string ("")
Property methods: CallerNameDisplayToLogical(), CallerNameGet(), CallerNameIsValid(), CallerNameLogicalToDisplay(), CallerNameLogicalToOdbc(), CallerNameNormalize(), CallerNameSet()
property ChildStatements as %List;
$LIST(...) of {StatementIndexHash} for all Children Queries
Property methods: ChildStatementsGet(), ChildStatementsIsValid(), ChildStatementsLogicalToOdbc(), ChildStatementsLogicalToXSD(), ChildStatementsOdbcToLogical(), ChildStatementsSet(), ChildStatementsXSDToLogical()
property CurrentWorkerCount as %Integer;
Number of workers currently active on behalf of this SQL Statement
Property methods: CurrentWorkerCountDisplayToLogical(), CurrentWorkerCountGet(), CurrentWorkerCountIsValid(), CurrentWorkerCountLogicalToDisplay(), CurrentWorkerCountNormalize(), CurrentWorkerCountSet(), CurrentWorkerCountXSDToLogical()
property ExecutionDuration as %Numeric (SCALE = 6) [ Required ];
Amount of time (in seconds) in which this SQL Query has been executing
Property methods: ExecutionDurationDisplayToLogical(), ExecutionDurationGet(), ExecutionDurationIsValid(), ExecutionDurationLogicalToDisplay(), ExecutionDurationNormalize(), ExecutionDurationSet(), ExecutionDurationXSDToLogical()
property ExecutionStart as %TimeStamp [ Required ];
Timestamp when this SQL Query started executing (in local timezone)
Property methods: ExecutionStartDisplayToLogical(), ExecutionStartGet(), ExecutionStartIsValid(), ExecutionStartLogicalToDisplay(), ExecutionStartLogicalToXSD(), ExecutionStartNormalize(), ExecutionStartOdbcToLogical(), ExecutionStartSet(), ExecutionStartXSDToLogical()
property ExecutionStartUTC as %TimeStamp [ Required ];
UTC timestamp when this SQL Query started executing
Property methods: ExecutionStartUTCDisplayToLogical(), ExecutionStartUTCGet(), ExecutionStartUTCIsValid(), ExecutionStartUTCLogicalToDisplay(), ExecutionStartUTCLogicalToXSD(), ExecutionStartUTCNormalize(), ExecutionStartUTCOdbcToLogical(), ExecutionStartUTCSet(), ExecutionStartUTCXSDToLogical()
property NameSpace as %String [ SqlFieldName = Namespace , Required ];
Namespace in which this SQL Statement was built/compiled into a Cached Query and invoked
Property methods: NameSpaceDisplayToLogical(), NameSpaceGet(), NameSpaceIsValid(), NameSpaceLogicalToDisplay(), NameSpaceLogicalToOdbc(), NameSpaceNormalize(), NameSpaceSet()
property Parameters as %List;
First 10 SQL Statement parameters (might be truncated)
Property methods: ParametersGet(), ParametersIsValid(), ParametersLogicalToOdbc(), ParametersLogicalToXSD(), ParametersOdbcToLogical(), ParametersSet(), ParametersXSDToLogical()
relationship Parent as INFORMATION.SCHEMA.CURRENTSTATEMENTS [ Inverse = SubStatement , Cardinality = one ];
Property methods: ParentGet(), ParentGetObject(), ParentGetObjectId(), ParentGetSwizzled(), ParentIsValid(), ParentNewObject(), ParentOnDelete(), ParentRClose(), ParentRExec(), ParentRFetch(), ParentRelate(), ParentSQLCompute(), ParentSet(), ParentSetObject(), ParentSetObjectId(), ParentUnRelate(), ParentUnSwizzle()
property ParentType as %String;
Parent Type: Parallel, Sharded
Property methods: ParentTypeDisplayToLogical(), ParentTypeGet(), ParentTypeIsValid(), ParentTypeLogicalToDisplay(), ParentTypeLogicalToOdbc(), ParentTypeNormalize(), ParentTypeSet()
property ProcessId as %String [ SqlFieldName = ProcessID , Required ];
Identifies the IRIS process ($JOB) in which this SQL Statement is running
Property methods: ProcessIdDisplayToLogical(), ProcessIdGet(), ProcessIdIsValid(), ProcessIdLogicalToDisplay(), ProcessIdLogicalToOdbc(), ProcessIdNormalize(), ProcessIdSet()
property QueryRunType as %String [ Required ];
SQL Query Run Type of this SQL Statement: EmbeddedSQL | DynamicSQL | xDBCQuery | ...
Property methods: QueryRunTypeDisplayToLogical(), QueryRunTypeGet(), QueryRunTypeIsValid(), QueryRunTypeLogicalToDisplay(), QueryRunTypeLogicalToOdbc(), QueryRunTypeNormalize(), QueryRunTypeSet()
property QueryStmtType as %Integer [ Required ];
SQL Query Statement Type # of this SQL Statement: 1 = SELECT | 2 = INSERT | 3 = UPDATE | 4 = DELETE | ... | 72 = CANCEL QUERY
Property methods: QueryStmtTypeDisplayToLogical(), QueryStmtTypeGet(), QueryStmtTypeIsValid(), QueryStmtTypeLogicalToDisplay(), QueryStmtTypeNormalize(), QueryStmtTypeSet(), QueryStmtTypeXSDToLogical()
property SQLStatementID as %Integer;
The second element of the AppMetadataStackID property, which is a unique SQL Statement Identifier that can be used to identify a SQL Statement that is stored in the SQL Statement Index (SSI)
Property methods: SQLStatementIDDisplayToLogical(), SQLStatementIDGet(), SQLStatementIDIsValid(), SQLStatementIDLogicalToDisplay(), SQLStatementIDNormalize(), SQLStatementIDSet(), SQLStatementIDXSDToLogical()
property Server as %String [ Required ];
Identifies the instance on which this SQL Statement is running: :
Property methods: ServerDisplayToLogical(), ServerGet(), ServerIsValid(), ServerLogicalToDisplay(), ServerLogicalToOdbc(), ServerNormalize(), ServerSet()
property StatementIndexHash as %String [ Required ];
SQL StatementIndex hash of this SQL Statement, which is used as a pointer to the internal definition stored in the SQL Statement Index (SSI)
Property methods: StatementIndexHashDisplayToLogical(), StatementIndexHashGet(), StatementIndexHashIsValid(), StatementIndexHashLogicalToDisplay(), StatementIndexHashLogicalToOdbc(), StatementIndexHashNormalize(), StatementIndexHashSet()
property StatementOrder as %Integer [ Required ];
Order in which this SQL Statement is being executed, based on the ^||oddSQL.CURRENTSTATEMENTS("orderStmts") $LIST(...)
Property methods: StatementOrderDisplayToLogical(), StatementOrderGet(), StatementOrderIsValid(), StatementOrderLogicalToDisplay(), StatementOrderNormalize(), StatementOrderSet(), StatementOrderXSDToLogical()
property Status as %String [ Calculated , Required ];
SQL Query Status: Preparing, Executing (Current Default), Closed, Aborted - or more fine-grained
Property methods: StatusCompute(), StatusDisplayToLogical(), StatusGet(), StatusIsValid(), StatusLogicalToDisplay(), StatusLogicalToOdbc(), StatusNormalize(), StatusSQLCompute()
relationship SubStatement as array of INFORMATION.SCHEMA.CURRENTSTATEMENTS [ InitialExpression = $listbuild("INFORMATION.SCHEMA.CURRENTSTATEMENTS","Parent",+$this,"many",1,1) , Transient , Inverse = Parent , Cardinality = many ];
Property methods: SubStatementGet(), SubStatementGetObject(), SubStatementGetObjectId(), SubStatementGetSwizzled(), SubStatementIsEmpty(), SubStatementIsValid(), SubStatementNewObject(), SubStatementRClose(), SubStatementRExec(), SubStatementRFetch(), SubStatementRelate(), SubStatementSQLCompute(), SubStatementSet(), SubStatementUnRelate()
property TPNestingLevel as %Integer [ SqlFieldName = TP_NestingLevel , Required ];
Current nesting level for Transaction Processing (TP)
Property methods: TPNestingLevelDisplayToLogical(), TPNestingLevelGet(), TPNestingLevelIsValid(), TPNestingLevelLogicalToDisplay(), TPNestingLevelNormalize(), TPNestingLevelSet(), TPNestingLevelXSDToLogical()
property UserName as %String [ Required ];
$USERNAME of person who created and invoked this SQL Statement
Property methods: UserNameDisplayToLogical(), UserNameGet(), UserNameIsValid(), UserNameLogicalToDisplay(), UserNameLogicalToOdbc(), UserNameNormalize(), UserNameSet()

Methods

classmethod GetSQLStatement(ns As %String = "", hash As %String = "", Output tSC="", normalize As %Boolean = 1, upper As %Boolean = 0) as %String [ SQLProc = GetSQLStatement ]
Projected as the stored procedure: GetSQLStatement
Get and return the SQL Statement Text based on the {NameSpace} & {StatementIndexHash} fields NOTE: Users with "USE" permission on the %Development resource can get all SQL Statements

Inherited Members

Inherited Methods

Storage

Gray indicates storage defined by superclasses.

Storage Model: SQLStorage

Maps: 1

  • Map number 1 is named Master

    thismap.Global: ^||oddSQL.CURRENTSTATEMENTS

  • ^||oddSQL.CURRENTSTATEMENTS({Server},{ProcessId},{StatementIndexHash})
    =
    Node Delimiter Piece Name
    Parent
    "childStmts" ChildStatements
    "info" 1 AppMetadataStackID
    "info" 5 TP_NestingLevel
    "info" 6 Parameters
    "info" 10 NameSpace
    "info" 11 CachedQuery
    "info" 12 CallerName
    "info" 20 StatementOrder
    "info" 1,1 ApplicationID
    "info" 1,2 SQLStatementID
    "info" 2,1 UserName
    "info" 21,1 CurrentWorkerCount
    "info" 21,2 ExecutionStart
    "info" 21,3 ExecutionDuration
    "info" 21,4 ExecutionStartUTC
    "info" 3,1 QueryRunType
    "info" 3,4 QueryStmtType
    "parent" 4 ParentType
FeedbackOpens in a new tab