User Guide > Objects > Alphabetical Listing > Database Tab

 Database Tab

The Database tab is object type-specific and is only available in Event object (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 script function 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

SQL Query

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 agent 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
For example: PC01:2281

The default ports are:

  • MS SQL Server: 1433
  • Oracle: 1521
  • DB2: 50000
  • MySQL: 3306

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 event 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.

Statistical Value

The value is directly specified.

Field/Element

Description

Statistical value

Any value.

Max. 40 characters

Variable Object

The value is retrieved from a Variable object.

Field/Element

Description

Variable object Name of a static or dynamic Variable object
Key column (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 variables) or the first value column (in dynamic variables).

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: