The Database tab is object typeAn individual object is provided for the individual activities: There are User, UserGroup, Notification, Cockpit, CodeTable, Documentation, Event, Agent, FileTransfer, Group, Include, Job, Workflow, Calendar, Login, Client, RemoteTaskManager, Schedule, Script, Server, Sync, Variable and TimeZone objects-specific and is only available in Event objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task (EVNT). It is displayed in databaseA database is an organized collection of data including relevant data structures. events and includes the definition of two values that should be compared to each other.
Object: Event
Object class: Executable object
Object type (short name): EVNT
The above tab shows three sections. Enter the first value in the section "Value 1" and the second one in "Value 2". In the "Operator" section, select the operator that should be used in order to compare the values as shown below:
Value1 Operator Value2
Operators:
The following sources are available for values:
The sources can be combined as you need them. For example, you can compare a value of an SQL query with a Variable object, or a statistical value with an SQL query, or two values of different or the same Variable object(s).
Time stamps of SQL queries and Variable objects are converted to the format "YYYY-MM-DD HH:MM:SS".
Note that fractional digits are truncated. Read the values in !Process by using the scriptA particular Automation Engine object type. functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… GET_EVENT_INFO and multiply them with 10n in order to move the commas. Subsequently, the values in !Process are ready to be compared.
Examples:
123.44 * 100 (corresponds to 102) = 12344
123.5555 * 10000 (corresponds to 104) = 12355555
In general values are interpreted and compared as string values.
If both values can be interpreted as positive integers (>=0), they will be compared as integer values.
Examples:
5 > 1: Values are interpreted as positive integers -> int 5 > int 1 -> true
1 > -1: Values are interpreted as strings -> string "1" > string "-1" -> false
The value is retrieved from an SQL query.
SQL queries can only be processed by a database agent.
Field/Element |
Description |
---|---|
SQL |
SQL query. Max. 4096 characters |
Host |
Name of the database agentA program that enables the de-centralized execution of processes (such as deployments) on target systems (computers or business solutions) or a service that provides connectivity to a target system (such as for databases or middleware). An agent is also an object type in the Automation Engine. [Formerly called "Executor."] See also: host that processes the SQL query. Agent groups cannot be selected in database events. |
Login | Name of the Login object that is used to log on to the database. |
Server |
Name of the computer on which the database is available. Format: Server name:Port The default ports are:
Do not complete this field if the query should be made in an Oracle database in RAC. |
Database | Name of the database. |
Only Microsoft Access: file name | Path and file name of the MS Access database. |
Click the button that shows three dots next to the text field SQL . An easy-to-handle editor opens in which you can enter the SQL query. Fill in the text fields Server, database etc., and the right editor section shows the corresponding database structure.
You can use object variables within an SQL query.
The database eventAction that is triggered if particular conditions apply. It can be an Automation Engine object type or an entry in a Policy Orchestrator EventBase. does not abort if the SQL query is incorrect.
Note that some databases distinguish uppercase and lowercase characters.
Result: A value
If the SQL query returns a particular value, this value will be used.
Result: No value
!Process is not processed.
Result: NULL
The database event converts NULL to the string "NULL".
Result: Several values or data records
If the SQL query returns more than one value, the first value of the first data record is used.
Example of an SQL result:
Last name | First name | Location |
---|---|---|
Smith | John | Seattle |
Green | Peter | New York |
The database event uses the value "Smith".
Reading the results using GET_EVENT_INFO
The script element GET_EVENT_INFO can be used to access the values of the SQL query in !Process.
Note that the database event only reads the first 10 columns. Column contents that exceed 255 characters are truncated.
The value is directly specified.
Field/Element |
Description |
---|---|
Statistical value |
Any value. Max. 40 characters |
The value is retrieved from a Variable object.
Field/Element |
Description |
---|---|
Variable object | Name of a static or dynamic Variable object |
Key columnColumn in static Variable objects that can be used to access values of a particular line. (in static Variable objects) First value column (in dynamic Variable objects) |
Value of the Key column or the first value column in order to determine the Variable object's entry that should be used. The value is retrieved from the Value 1 column (in static variablesA Variable object with the setting "Source" - "Static": Variable values are entered by a user or with a script and remain stored in the object.) or the first value column (in dynamic variablesA Variable object with the attributes "Source" - "EXEC", "SQL", "SQL internal", "Multi" or "Filelist". Values are directly retrieved from the data source and not stored in the object.). |
The database event is not activated if the key does not exist in the specified Variable object.
If the key does not include a value, the reaction depends on the setting that has been defined in the Variable object's Attributes tab. The system either logs an error message or uses the initial values. The database event does not abort.
See also:
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |