Working with Event Tables¶
You can perform a subset of table operations on an event table, which is specifically designed for capturing events. The sections in this topic describe the operations an event table supports.
Operations Supported on an Event Table¶
Because an event table is designed specifically for capturing events, you cannot perform some of the operations on an event table that you can perform on a table.
With an event table, you can perform only the following operations:
Deleting Rows from an Event Table¶
If you need to delete rows from an event table, you can use the following commands:
Parameters for Event Tables¶
You can use the following parameters to specify how the event table should be used by handler code.
Specifies the name of the event table for logging messages from stored procedures and UDFs in this account. For reference information, refer to EVENT_TABLE.
Specifies the severity level of messages that should be ingested and made available in the active event table. Messages at the specified level (and at more severe levels) are ingested. For more information, refer to LOG_LEVEL and Setting Log Level.
Specifies the verbosity of trace events that should be ingested and made available in the active event table. Events at the specified level are ingested. For more information, refer to TRACE_LEVEL and Setting Trace Level.
Access Control Privileges for Event Tables¶
You can use privileges in the global and event table scope to manage access to operations on an event table.
Managing Access to Event Table Data¶
When it’s impractical for you to make event table data available to a range of users and roles, you can create views for access by users with specific roles.
An account can have only one active event table. When you want to manage access to the data in this single table, you can create views on the event table, then grant access for each view to separate roles. Through the view, a role might have access to specified subset of the data in the event table.
For more information about creating view, refer to CREATE VIEW.
Using Streams to Track Changes to Event Tables¶
You can create a stream on an event table, such as to capture changes to the table.
Code in the following example creates a stream to capture inserts on the event table
CREATE STREAM append_only_comparison ON EVENT TABLE my_event_table APPEND_ONLY=TRUE;