Query Constant Files for SQL System Connections

Query constant files are configuration files containing constant values that may be referenced by any SQL script run by the Agentry Server. Each SQL Database system connection can have its own query constant file. By default, there are two such files installed with the Server:

As the names imply each is intended for use by a system connection to one of the Oracle or SQL Server database systems. The values contained in these scripts are intended to be used in making SQL commands, either from definitions within the application or those run from the query initialization file (SqlBe.ini), more portable. Using the values listed within these files, a single SQL statement may be written that will execute properly in any of the database systems just mentioned.

The values within these files are accessible within a SQL statement run by the Server via SDML data tags. Following is a list of the values contained in the default versions of these files. Like all other configuration files for the Server, the query constant files can contain multiple sections. By default they contain the single section [Database], which contains all of the following options:

Additional Query Constant File Sections

In addition to the standard [Database] section of the query constants files, other sections may be added for application-specific purposes, such as:
  • The application extends a back end system that may be deployed on different database systems, and certain values or functionality is different within those systems.
  • The application extends a back end system deployed in multiple languages. As a result, certain constant values, such as Y and N flags, are different in different languages. In this case, the values can be represented as options here, and these would then be the items referenced via SDML in the SQL statements. When deployed in a different language, the constant file can be updated with the proper language-specific value.
  • Additional functions may be needed beyond those in the standard version of the query constants file. In this case it may be considered cleaner to add a separate section to differentiate between those functions added after the fact, and those provided by default.

In almost all situations the contents of this file are modified by, or at the direction of the application developer, as the values are referenced as a part of the application’s business logic. Changes made at implementation time should only be performed with an understanding of the affect such changes will have and the ways in which the configuration options are used. Furthermore, the default values provided with the Agentry Server should only be changed in the rarest of situations, particularly those related to the formats of date and time values.

Configuring the Query Constant Files for a System Connection

It is possible for a single SQL Database system connection to make use of multiple query constant files. It is also possible to change the name of the file referenced for the connection. This is accomplished by changing the configuration option queryConstantFiles in the [SQL-n] section within the Agentry.ini file.

If a different file name is to be used, or if multiple constant files are needed for a system connection, the queryConstantFiles configuration option should be modified to reference this. For multiple file listings, each file name is separated by a semi-colon.
-- different file name
[SQL-1]
...
queryConstantFiles=MyConstantFile_sd.ini
...
--- multiple constant files
[SQL-1]
...
queryConstantFiles=oracle_sd.ini;MyApplicationConstantFile_sd.ini

If a different file is to be used from the default file, that file must contain the [Database] section, including all configuration options.