Configuring Query Constant Files for Agentry Applications

Query constant files are configuration files containing constant values that may be referenced by any SQL script run by SAP Mobile Platform Server. Each SQL database system connection can have its own query constant file.

By default, there are two such files installed in the SAP Mobile Platform installation directory (SMP_HOME\Server\Configuration\com.sap.mobile.platform.server.agentry\):
Note: These default files should not be modified. Instead, copy the files to com.sap.mobile.plaform.server.agentry.application, and modify the copies. Otherwise changes will be lost if the server is upgraded; files in com.sap.mobile.platform.server.agentry could be overwritten by the installer.

The values in these scripts are intended to make SQL commands more portable when executed, either from definitions within the application, or from the query initialization file (SqlBe.ini). You can use the values in these files to write a single SQL statement that executes properly throughout the applicable database system.

SDML data tags make the values within these files accessible to SQL statements that are run by the server. Like all other configuration files for the server, the query constant files can contain multiple sections. By default, each contains the single section [Database], which includes these values:

Additional Query Constant File Sections

You can add other sections to the query constants files, which includes values or functionality for application-specific purposes. The contents of this file are usually modified by, or at the direction of, the application developer, as the values are referenced as a part of the application’s business logic. Before making any changes, understand the effect that such changes will have, and how the configuration options are used. The default values provided with SAP Mobile Platform Server should only be changed in the rarest of situations, particularly those related to date and time formats.

Examples of application-specific changes:
  • 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 that is deployed in multiple languages. As a result, certain constant values, such as Y and N flags, are different in different languages. You can represent such values as options in an application-specific section, to become the items referenced via SDML in the SQL statements. When the application is deployed to different languages, you can update the constant file with the proper language-specific value.
  • Additional functions may be needed beyond those in the standard version of the query constants file. It may be more straightforward to add a separate section that differentiates between the functions that are provided by default, and those that are added later.

Configuring the Query Constant Files for a System Connection

A single SQL database system connection might use multiple query constant files. You can also change the name of the file that is referenced for the connection.

If a different file name is to be used, or if multiple constant files are needed for a system connection, modify the queryConstantFiles configuration option, in the [SQL-n] section, of the Agentry.ini file. For multiple file listings, each file name is separated by a semicolon.
-- different file name
[SQL-1]
...
queryConstantFiles=MyConstantFile_sd.ini
...
--- multiple constant files
[SQL-1]
...
queryConstantFiles=Oracle_sd.ini;MyApplicationConstantFile_sd.ini

If you use a query constant file other than the default, the file you use must contain the [Database] section, including all configuration options.