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.
Prerequisites
To be able to define SQLI VARA objects, the following must be true:
- SQLVAR_INTERNAL is set to YES, see SQLVAR_INTERNAL
- Your user definition has the right to Create and modify SQL-internal variables
Important Considerations
-
Database VARA objects (SEC_SQLI, SEC_SQL, SQLI, and SQL types) do 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.
-
In database VARA objects (SEC_SQLI, SEC_SQL, SQLI, and SQL types), the system does not check the SQL statements that are processed for technical reasons. 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, database VARA objects (SEC_SQLI, SEC_SQL, SQLI, and SQL types) return the value "" (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.
-
PromptSet variables are supported in select fields for BACKEND, EXEC, FILELIST, SEC_SQLI, SEC_SQL, SQLI, SQL, and XML variable types. Using PromptSet variables is necessary when using the Dynamic Reload (Combobox Prompts) feature.
-
You can include PromptSet variables here when using the Dynamic Reload (Combobox Prompts) 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.
Defining SQLI VARA Objects
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. This topic describes the SQLI-specific settings on the Variables page.
-
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
Defining the Variables Page
-
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 (Combobox Prompts) 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.
- If you are logged in to Client 0, an additional section is available. For more information, see Client 0 VARA Objects in Other Clients.
-
To run a command, select it and 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
- Save your changes.
See also: