Technical Information and Troubleshooting
This section includes discussion of a number of features of the Expose Utility. In addition, a list of the errors that may be encountered during the execution of the utility is detailed.
Character and Column Name Conversion
Section titled “Character and Column Name Conversion”During the expose process each table name (derived from the link name) and column name is edited to ensure that it will conform to SQL syntax standards. To this end, the following conversions will take place:
- Only the characters 0-9, A-Z and a-z are valid for column and table names. All other characters will be converted to an “X” except for the “#” sign which will be replaced with an “N” and the “%” which will be replaced with a “P”.
- The first character of a column or table name must be a letter. Any numbers in this position will be replaced with letters. 0 will be replaced with A, 1 with B and so on.
- Columns that may be misread as SQL reserved words will be modified to avoid misinterpretation. For example, a column called DATE will be replaced with a column called DATEX. The list of reserved words can be found in the data file ODDRESWD, which is referenced via Dictionary-IV with the link odLRESWD.
Table Name Construction
Section titled “Table Name Construction”The section titled Character and Column Name Conversion lists the general rules for dealing with special and valid characters used for table names. This section describes the conventions and constraints used to build table names from the Dictionary-IV Link names. In most cases, the table name used during ODBC access corresponds character-for-character with the Dictionary-IV defined Link Name. However, in a number of circumstances, this is not true.
File Suffixes
When file suffixes are defined for a link, the number of tables generated corresponds to the number of file suffixes defined. This is due to the one-to-one relationship between tables and physical data a file that is expected by the ODBC rules. The resultant table name consists of the Link Name + File Suffix. For example, link UTCUST defined with suffixes DEM and CMP results in two tables, UTCUSTDEM and UTCUSTCMP. Beginning with version 8.8.0, File Suffix Methods defined in the link have been disabled. Should this functionality be required, it may be enabled by adding PRM ODBCFS to the appropriate IPL file.
Upper/Lower Case Characters
While upper and lowercase characters are valid in link names, some restrictions are implied by the SQL engine. Since SQL is case insensitive, two links that contain the same characters but differ in case only trigger a modification to one link’s resultant table name. That is, links UTCUST and UTcust are exposed with table names UTCUST and UTCUST1.
Table Name from Link Header
The resultant Table Name may be defined in the Dictionary-IV Link Header using the Server Table Name field. The first 17 characters of this field will be used. This field must be defined prior to adding links to the Data Source. Refer to the Dictionary-IV instructions for modifying a link header.
A number of the constructs supported in Dictionary-IV for sort definitions are not valid in SQL. Sorts defined with any of the following items will not be exposed. The client application will still be able to sort the data in any way that it supports, but there may be a performance consequence.
- Sorts defined with substrings of columns.
- Descending sorts.
Log file
Section titled “Log file”The Expose Utility will update a log file, tsexp.log, when any of the events described in the sections titled How to unexpose a link and How to update an exposed link occur. This log will be found in the directory specified by the WORK-FILE-DIRECTORY field in the Control file. The information in this file consists of warnings and will not prevent the Data Source from operating.
TSODBC.INI
Section titled “TSODBC.INI”This file is maintained by the Expose Utility. It is located in the appropriate system directory for the Single-Tier AND Windows server products and in /usr/lib/basic for the UNIX server Tier product. It is organized in sections by IPL files, base directories, and Data Sources. Each Data Source section contains the IPL file name and base directory information used by the server process to locate the data files and IDDBD. The format of the file is:
[IPL]
A001=/opt/tbred/basic/IPLINPUT
[PWD]
A001=/opt/tbred/basic/
[OEFILES]
IPL=/opt/tbred/basic/IPLINPUT
PWD=/opt/tbred/basic/
LOG=15,/usr/lib/basic/OEFILES.LOG
[UTFILES]
IPL=/opt/tbred/basic/IPLINPUT
PWD=/opt/tbred/basic/
LOG=15,/usr/lib/basic/UTFILES.LOG
[IPL]
A001=
[PWD]
A001=C:\ProgramData\Thoroughbred Software\Tbsc\
[OEFILES]
PWD= C:\ProgramData\Thoroughbred Software\Tbsc\
[UTFILES]
PWD= C:\ProgramData\Thoroughbred Software\Tbsc\
On Windows, the TSODBC.INI file is created in the base directory, for example, C:\ProgramData\Thoroughbred Software\Tbsc. To change the location of the TSODBC.INI file to the Thoroughbred System directory, create the ODBCEXU.INI file in the IDL4 directory of the base directory with the following:
[OS]
Name=C:\ProgramData\Thoroughbred Software
DataSources
Section titled “DataSources”The IPL= line refers to the name of the IPL file used and the PWD= line lists the corresponding base or home directory for any relative paths configured in the IPL file. There will be a separate section in the TSODBC.INI file for each Data Source defined.
There are a number of other lines that can be manually configured in the file specific to each Data Source. Be aware that running the Expose Utility may remove any manually entered line.
LOG=log-flag[,log-file-name] controls logging for the Data Source. The log-flags controls the information to be logged:
| 1 | Log Thoroughbred File handler API calls |
| 2 | Log ISAM API calls |
| 4 | Log ODBC API calls |
| 8 | Log network packets |
| 16 Log server client statistics |
The log-file-name, if specified, contains the name of the log file for the Data Source. If not defined, messages will be written to the TSODBC.LOG file.
TXT= mval controls the amount of data returned for text fields. Valid values for mval range form 200 to 32767. Note this value does not control the length of the data returned. Each ODBC application has its own maximum value that can be returned for text fields. This configures the value that the TS ODBC Server will reserve for the data returned.
TIM=mval can be specified in TSODBC.INI to force termination when a connection has been idle for mval minutes. Minutes cannot exceed 4 digits. A message is written to TSODBC.LOG that includes the Data Source Name and the User Login.
IPLPRM=N can be specified to ignore the IPLPRM file for the Data Source.
Error Messages
Section titled “Error Messages”The following is a list of error messages or conditions that may occur during the Expose Utility execution.
Messages
- “Cannot locate windows system directory”
This message will occur if the WINDIR environment variable has not been set. - “Cannot access the TSODBC.INI file”
Check permissions on the file. - “Control file locked by another user”
The Expose Utility can only be executed by one user at a time. - “No hierarchical directory configured”
A hierarchical directory must be set up in the IPL file. Refer to the Thoroughbred Basic Customization and Tuning Guide for details.
Conditions
The link does not appear in the Exposed Link window. This will occur for one of the following reasons:
- Bad format.
- No format defined in the link.
- No key fields defined.
- No data file defined in the link.
From the TS ODBC DataServer Reference, version 8.9.1. Open this page in the PDF