INI Definition |
Structured text files (INI files) may be used to manually define data that is not normalized (i.e. data sources with more than one record type) or cannot be handled by the PxPlus Data Dictionary. INIs are typically used to define files from legacy systems that were not created using the NOMADS Data Dictionary facilities.
These definition files consist of a Table Declaration section that assigns a logical table name to the physical path of each file. The logical names become section headings for column definitions. The maximum line length in an INI definition is 255 characters. The INI contents are described in the sections below.
The [*tables*] declaration section is used to assign a logical name to a database's physical filename.
Example:
[*tables*]
INVOICELINE=\INVOICE\INVLINE
CLIENT==%c$+"cstfile"
The [*tables*] section heading is not case sensitive; however, square brackets, asterisks, and the word tables are all part of the required syntax. The syntax for assigning a logical table appears as follows:
table_name=path_filename[ ,alternate.INI ] [ ,SORTTABLE ]
Where:
table_name |
Logical name assigned to the physical file. Example: In this example, invoiceline is the logical name for the physical file invline in the invoice directory: *tables*] |
path_filename |
Physical location and file name of database in the system. Either absolute or relative path names can be specified. Relative path names are resolved based on the database directory setting in the PxPlus SQL ODBC Driver configuration. If the first character of the path is an = (equals sign), the PxPlus SQL ODBC Driver treats the path as an expression and replaces all instances of %c$ with company, %u$ with user ID, and %s with session ID that are supplied during the connection. Example: Client==%c$+"cstfile" In this example, if ABC is entered in the Company field of the PxPlus SQL ODBC Driver, then Client would be evaluated to ABCcstfile. |
alternate |
Optional alternate INI definition file. Early Windows systems had a limit on the amount of information that could be stored in a single INI file. This option allows the definition to be spread over multiple INI files to keep the size of any one file below 64K. It is now more commonly used to specify that the INI definition overrides the embedded dictionary definition. |
SORTTABLE |
Optional entry informing the PxPlus SQL ODBC Driver that the column definitions are not defined in the file in physical order. The physical order is controlled through the use of the FIELD= keyword. The default is that all fields are defined in the physical order that they exist in the file. |
The record descriptors define logical columns extracted from the PxPlus data file with each entry consisting of:
The minimum information required is a column name and its length. All columns default to string, delimited. The column descriptors can be in any order and are comma delimited. Only the first three characters of the keywords are required. Invalid keywords are ignored.
Column descriptors have the following format:
[table_name]
column_name = LENGTH=length,[type, formatting, attributes]
Where:
column_name |
Logical name of the column. Example: [Client] In this example, CustomerID is the first column in the logical table, Client and Name is the second. | ||||||||||||||||||||||
length |
Mandatory value. Use a numeric expression or integer for length. Example: LEN=30 If desired, you can set the number of digits to the right of the decimal. Example: LEN=5.2 | ||||||||||||||||||||||
type |
Optional type. The following keywords set the type of the data:
| ||||||||||||||||||||||
formatting |
Optional format mask. The following keywords describe the layout of data in the file:
| ||||||||||||||||||||||
attributes |
Optional attributes that are not handled by the Data Dictionary:
|