TDWMEventStatus Function | Application Programming Reference | Teradata Vantage - 17.05 - TDWMEventStatus - Teradata Database

Teradata Vantageā„¢ - Application Programming Reference

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
17.05
created_date
June 2020
category
Programming Reference
featnum
B035-1090-170K

Purpose

Returns the currently defined events.

Definition

REPLACE FUNCTION TDWM.TDWMEventStatus(
    RequestType       VARCHAR(1) CHARACTER SET LATIN
  )
  RETURNS TABLE
   (EventId           INTEGER,
    EventStatus       CHAR(1) CHARACTER SET LATIN,
    EventActiveDate   INTEGER,
    EventActiveTime   FLOAT,
    ExpressionId      INTEGER,
    ExpressionStatus  CHAR(1) CHARACTER SET LATIN,
    ExpActiveDate     INTEGER,
    ExpActiveTime     FLOAT,
    RecordType        VARCHAR(8) CHARACTER SET LATIN,
    RecordId          INTEGER,
    RecordStatus      CHAR(1) CHARACTER SET LATIN,
    DueToDuration     CHAR(1) CHARACTER SET LATIN,
    ActiveDate   INTEGER,
    ActiveTime   FLOAT
   )
                   .
                   .
                   .
;

Input Parameter

Input Parameter Description
RequestType A= Return all events.

C = Return current state events.

Usage Notes

The TDWMEventStatus function provides similar functionality to an EVENT STATUS request. For more information about this interface, see EVENT STATUS.

Result Rows

Column Name Description
EventId Internal ID of the Event. A value of zero indicates there is no event for this record entry and there are no events for the Normal SysCon, the Always OpEnv and a State.

Events are reported in the order they appear within the associated expression. Only events in the associated expression are included.

EventStatus Current status of the event. The value is either Inactive or Active.
EventActiveDate Date when EventStatus was last changed. This is the date when the EventStatus was set to Inactive or Active.
EventActiveTime Time when EventStatus was last changed. This is the time when EventStatus is set to Inactive or Active.
ExpressionId Internal ID of the Expression. A value of zero indicates there is no expression for this record entry.

There are no expressions for the Normal SysCon, the Always OpEnv, and a State.

For the CURRENT state request, the first TRUE expression for the State is included. When there are multiple TRUE expressions for a state, only the first one processed is reported. The order of processing is consistent within a rule set and, therefore, the same TRUE expression is reported on every request.

ExpressionStatus Current status of the Expression:
  • 0 = Inactive
  • 1 = Active
ExpActiveDate Date when ExpressionStatus last changed.
ExpActiveTime Time when Expression Status was last changed. This is the time when Expression Status was set to either Active or Inactive.
RecordType Type of record, for example: a SysCon, OpEnv, or Notify Only Expression.
RecordId Internal ID of the SysCon or OpEnv depending on the type of record specified in the RecordType field.

A value of zero indicates the Notify Only Expression record type.

RecordStatus Current status of the SysCon or OpEnv record:
  • Y = Active
  • N = Inactive
DueToDuration An indicator that the corresponding Syscon is being considered as TRUE or is TRUE:
  • 0 = Inactive if the SysCon is TRUE based on the defined expressions.
  • 1 = Active if the corresponding SysCon is being considered as TRUE due to the MinDuration value being in affect.
This field is valid only when SysCon is the specified RecordType.
StateActiveDate Date when RecordStatus was last changed.
StateActiveTime Time when RecordStatus was last changed.

Example: Using TDWMEventStatus

SELECT * FROM TABLE (TDWM.TDWMEventStatus('c')) AS t1;
 *** Query completed. 3 rows found. 14 columns returned.
 *** Total elapsed time was 1 second.
         EventId            0
     EventStatus  I
 EventActiveDate            0
 EventActiveTime   0.00000000000000E 000
    ExpressionId            0
ExpressionStatus  I
   ExpActiveDate            0
   ExpActiveTime   0.00000000000000E 000
      RecordType  SYSCON
        RecordId            1
    RecordStatus  A
   DueToDuration  N
      ActiveDate      1070518
      ActiveTime   8.39380000000000E 004
         EventId            0
     EventStatus  I
 EventActiveDate            0
 EventActiveTime   0.00000000000000E 000
    ExpressionId            0
ExpressionStatus  I
   ExpActiveDate            0
   ExpActiveTime   0.00000000000000E 000
      RecordType  OPENV
        RecordId            1
    RecordStatus  A
   DueToDuration  N
      ActiveDate      1070518
      ActiveTime   8.39380000000000E 004
         EventId            0
     EventStatus  I
 EventActiveDate            0
 EventActiveTime   0.00000000000000E 000
    ExpressionId            0
ExpressionStatus  I
   ExpActiveDate            0
   ExpActiveTime   0.00000000000000E 000
      RecordType  STATE
        RecordId            1
    RecordStatus  A
   DueToDuration  N
      ActiveDate      1070517
      ActiveTime   1.00006000000000E 005