Use this procedure to query events.
Syntax | Description |
---|---|
start_at_event_id |
BIGINT. This is an IN parameter that specifies the ID of the event from which to start the query. |
max_events_to_fetch |
BIGINT. This is an IN parameter that specifies the maximum number of events to fetch. |
Result | Description |
---|---|
event_id |
BIGINT. A unique ID assigned to each event. The value is incremented by 1 for each new event. |
event_class |
VARCHAR(1). The event class. The class can be either I for information or E for error. |
event_type |
VARCHAR(8). The event types are listed below.
|
agent_id |
VARCHAR(128). The ID of the agent that produced this event. |
remote_id |
VARCHAR(128). The ID of the remote database that the event applies to. This is only set for task-related events that target a specific remote database. |
task_name |
VARCHAR(128). The name of the task. This is only set for task-related events. |
command_number |
INTEGER. The command number within a task that this event applies to. This is only set for command-specific events. |
run_number |
BIGINT. The unique number assigned to each run of a task. This is only set for task-specific events. |
duration |
INTEGER. The amount of time taken by the event. This is only set for command-specific events. |
event_time |
TIMESTAMP. The time the event took place. For most events the time is based on the clock of the computer the agent is executing on. |
event_received |
TIMESTAMP. The time the event was received by the server. This is always set from the clock of the consolidated database. |
result_code |
BIGINT. An event-specific BIGINT. For example, for a SQL query command result, the code would be the SQLCODE. |
result_text |
LONG VARCHAR. An event-specific LONG VARCHAR. For example, for a SQL query command result, this column would contain a CSV format of the result set. |
p_crsr |
SYS_REF_CURSOR. This is an OUT parameter for Oracle only. |
Alternatively you can use the ml_ra_get_task_results procedure, which only fetches events related to a specific run of a task. You can pass in a null @run_number to get the latest run of a task.
One way to use this procedure is to use ml_ra_get_agent_events to wait for a task-end event (TE) then call ml_ra_get_task_results to get each of the command results that might need processing.
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |