SQLI VARA Objects
SQLI or SQL Internal variable objects retrieve values from the Automation Engine database using SQL statements. You do not have to specify a Connection or a Login object because the database access remains internal. There is no limit to the length of the values. If you set one, this value applies to the first value column only. Items exceeding this limit are excluded.
To determine the maximum number of returned lines, use the SQLVAR_MAX_ROWS setting in the UC_SYSTEM_SETTINGS variable. For more information, see SQLVAR_MAX_ROWS.
This page includes the following:
Prerequisites
- SQLVAR_INTERNAL is set to YES, see SQLVAR_INTERNAL
- Your use definition has the right to Create and modify SQL-internal variables
Overview
An SQLI VARA object definition is made up of the following pages:
-
Common to all object types, here you define basic object information and apply custom values to it
-
Variables
Here you define the object-specific settings. Some sections on this page are common to all VARA objects and are described for all of them in dedicated topics:
- Variable Settings, see below
- Data Types and Formatting
- Script Access
- Client 0 VARA Objects in Other Clients
- Preview, see below
-
Common to all object types, here you find a list of all versions of the object
-
Common to all object types, here you enter information that you consider important to understand the configuration and behavior of the object
Notes:
-
This type of VARA object does not support binary fields. Binary data that result from an SQL query causes an error in the preview or when the values are retrieved at runtime.
-
For technical reasons, the system does not check the SQL statements that are processed with database VARA objects (SEC_SQLI, SEC_SQL, SQLI, and SQL types). This means that you can change or delete data records by using VARA objects. For security reasons, consider restricting user access accordingly. If possible, deploy a database user with read-only rights for VARA objects that can access an external database (SQL, SQL SECURE). For internal SQL variables (SQLI, SQLI SECURE), you can limit object access via a privilege (create and modify SQL-internal variables).
-
Depending on the data type, this VARA object returns "" (string, date, time, timestamp) or 0 (number) for NULL values.
Important! A conversion error that occurs while running SQL commands on MS SQL server databases can cause a deadlock or an inconsistent transaction with an unforeseen result. It is recommendable to verify the commands in SQLI variables very carefully because the Automation Engine cannot intercept such an error.
-
Use PromptSet variables here when you use the Dynamic Reload feature for combo box prompts. The PromptSet variables are resolved when the object that includes the PromptSet is executed.
-
You can include PromptSet variables here when using the dynamic reload feature for combo box prompts. When you use PromptSet variables in a dynamic VARA object, the Preview feature returns an error. This is because the PromptSet variables do not exist in the dynamic VARA object. However, the PromptSet variables will be resolved when objects including the PromptSet are executed.
To Define an SQLI VARA Object
-
In the Variable Settings section, specify the following:
-
Type
Read-only, always SQL
-
Oracle Statement / SQL Server Statement / DB2 Statement / PostgreSQL Statements
SQL statements used to select specific database entries that serve as variable values. You have two options:
- Type your statement in the input field
- Click the icon to open the cell editor and enter your SQL statement
Example:
select * from OH
Maximum length: 4096 characters
Notes:
- SQL statements are not checked. You can change or delete database entries
- The Automation Engine does not verify whether these SQL commands include errors or are dangerous. They are passed on to the database without being verified. This means that an execution error will only occur during database access, which is when the variables are being resolved.
- Using Inserting Variables/VARA Objects in Objects and Scripts or other VARA objects requires you to specify the setting VAR_SECURITY_LEVEL in the UC_SYSTEM_SETTINGS - Systemwide Settings variable accordingly. Otherwise, the variables are not replaced (standard) and a database error occurs.
-
You can include PromptSet variables here when using the dynamic reload feature for combo box prompts. When you use PromptSet variables in a dynamic VARA object, the Preview feature returns an error. This is because the PromptSet variables do not exist in the dynamic VARA object. However, the PromptSet variables will be resolved when objects including the PromptSet are executed.
-
-
Define the Data Types and Formatting.
-
Define the Script Access.
-
To run and check the command that you have entered in the statement section, click Preview. The statements are executed and their results displayed. The preview function serves to check for potential errors in the database statements (for example, it the data type of the VARA object and of the database do not match).
Example:
select oh_name from oh
where oh_otype = 'JOBI'
and oh_deleteflag = 0
and oh_client = &$CLIENT#
order by oh_name asc
-
To export the content of the preview table to a CSV file, click Export Table. All rows and column are exported. Use this function if you need to further process the content of the CSV file (paste it to a different application for further processing and so on).
-
To copy one or more rows in the Preview table, select the Copy button. The selected rows are copied to the clipboard and you can paste them to a third party tool (Google, Sheets, Excel, text editor, and so on).
Note: This function is available only if
https
is used on the Automic Web Interface . -
Save your changes.
See also: