Tested and Supported
Not Tested: Likely Supported
Not Tested
Not Supported
The fact that the XDD initially does not contain any error handling information immediately exposes data conversion errors to a SQL user. This provides the way to begin troubleshooting data conversion errors and to identify the proper settings to specify in your XDD file.
Visually Check Data with FairCom DB SQL Explorer
FairCom DB SQL Explorer and FairCom DB Explorer include a button to simplify identifying "bad" records.
To check for bad records in FairCom DB SQL Explorer or FairCom DB Explorer:
Check using a SQL Query
You can use the procedures in this section to identify data-conversion errors and use that information to fine-tune your XDD files.
If a query fails, it is possible the failure is due to a problem with SQL data conversion. Troubleshooting this type of error is quite easy with the following steps:
SELECT * FROM <table>
If none of the queries fail, the original query failure is not due to a conversion problem.
SELECT * FROM <table> ctoption(badrec)
ctoption(badrec) is a FairCom DB extension to SQL indicating the query should return only records having conversion errors and expose values that do not properly convert as NULL.
CTSQLCBK.FCS Log
The ctoption(badrec) command generates a log file, ctsqlcbk.fcs, in the FairCom DB SQL Server directory that can be used to determine the exact conversion error and the data causing it. This file lists all the fields that caused a conversion error exposed in SQL along with the value of the data that could not be converted. Note that the log contains information for the fields that result in propagating the conversion error to SQL. It does not log conversion errors that result in a SQL value because they were already handled successfully following the settings in the XDD.
Each log entry is made of three lines:
Convert error XXXX on field[YYYY]
Where XXXX is the error code indicating the cause of the conversion error, YYYY is the field on which the conversion error occurred.
For example:
Convert error 4028 on field[FIELD1]
{ctdbStringFormatToDateTime} on 0000000000 failed
00000000
Convert error 4028 on field[FIELD2]
{ctdbStringFormatToDate} on 00000000 failed
3030303030303030
Convert error 4118 on field[FIELD3]
[NormalizeCobolStr] ascii value is not a digit
2020202020202020
Convert error 4118 on field[FIELD4]
[NormalizeCobolStr] ascii value is not a digit
2020202020202020
The following message was seen when attempting to connect to FairCom DB SQL after a COBOL table had been imported with the ctutil -sqlize option:
Error : -17438 "ExecuteReader - CT - Requested def blk is empty"
Along with that, the following message is logged in CTSTATUS.FCS
Mon Oct 1 13:59:43 2012
- User# 00001 LoadSQLSDK: Failed to load SQL callback library libctsqlcbk.so: dynamic linker : ./ctreesql : could not open libctsqlcbk.so
Mon Oct 1 13:59:43 2012
- User# 00001 : PANIC - TPEUTIL LoadSQLSDK callback library load failed PID 20028
A COBOL resource in the file is closely related to the referenced callback routine needed by SQL for data type conversions.
Configuring the LD_LIBRARY_PATH environment variable to correctly pick up the path to libctsqlcbk.so for the server process owner should correct this error.
The FairCom RTG solution is enabled through a server-side callback module, which implements c-treeDB callback routines. Errors that occur within these routines generate a standard c-treeDB error code that is context sensitive to this implementation. Here is a list of possible return codes from this module, and their meaning in FairCom RTG XDD handling.
Symbolic |
Error Code |
Description |
---|---|---|
CTDBRET_CALLBACK_1 |
4109 |
Could not find schema in XDD |
CTDBRET_CALLBACK_2 |
4110 |
Record length does not match extended data definitions |
CTDBRET_CALLBACK_3 |
4111 |
Invalid or corrupted XDD resource |
CTDBRET_CALLBACK_4 |
4112 |
Syntax error parsing extended data definitions |
CTDBRET_CALLBACK_5 |
4113 |
Internal error |
CTDBRET_CALLBACK_6 |
4114 |
Could not find field in XDD |
CTDBRET_CALLBACK_7 |
4115 |
Could not find filter in XDD |
CTDBRET_CALLBACK_8 |
4116 |
Too many schemas in XDD |
CTDBRET_CALLBACK_9 |
4117 |
Error setting filter condition on schema |
CTDBRET_CALLBACK_10 |
4118 |
Field value conversion error |
CTDBRET_CALLBACK_11 |
4119 |
Unsupported CLOB/BLOB definition in XDD |
CTDBRET_CALLBACK_12 |
4120 |
Index not supported on field type |
CTDBRET_CALLBACK_13 |
4121 |
Missing or bad dbtype information in XDD |
CTDBRET_CALLBACK_14 |
4122 |
Invalid filter key settings in XDD |
CTDBRET_CALLBACK_15 |
4123 |
"Regular" field found after virtual fields in the XDD <schema> (in earlier releases: Invalid field default settings in XML definitions) |
CTDBRET_CALLBACK_16 |
4124 |
Not used |
CTDBRET_CALLBACK_17 |
4125 |
Key definition does not match XDD information |
CTDBRET_CALLBACK_18 |
4126 |
Missing or bad value in XDD |
CTDBRET_CALLBACK_19 |
4127 |
Internal error (unexpected field type) |
CTDBRET_CALLBACK_20 |
|
Not used |