Database Engines:ads

Special ADT table format considerations Professional

ADT,ADI and ADM format considerations

The new ADT table format is an Advantage properitary file format and is only usable by applications accessing data through the Advantage database server. The Advantage proprietary file format cannot be read by any other application/driver supporting Xbase file formats. The Advantage proprietary format consists of ADT tables, ADI index files, and ADM memo file.

In the following the major incompatibilites and differences to standard Xbase tables are outlined.

New datatypes, select carefully

ADT tables support a whole new range of datatypes, proper datatype selection and planning is necessary to avoid migration problems. Data types such as Numeric and ShortDate/CompactDate are not available in ADT.

Special care must be taken into account when migrating financial applications or other applications relying on proper rounding if performing arithmetic operations. With standard Xbase tables the NUMERIC data type is an exact numeric which means with each arithmetic opertions the value is rounded to the amount of decimals specified in the table structure. With ADT tables float and double datatypes are approximate numerics, which means no rounding takes place and rounding errors occur.

ADT tables do not support the NUMERIC datatype but double and float instead, therefore rounding errors occur if arithmetic operations are based on fields. However NUMERIC datatypes with a decimal of 4 can be migrated to the ADT Money datatype which behaves exactly such as an exact numeric type does. All other NUMERIC datatypes have to be migrated to Double, Float, Integer or ShortInt depending on their range of values. In addition, existing source code must be reviewed and proper rounding must be added to the code.

DbDelete() can not be recalled

With ADT tables a DbDelete() operation logically removes the record from the table. Deleted records cannot be "un-deleted" or "recalled". Navigation on a deleted record is possible using DbGoto(), however an attempt to lock or write to the record fails with an runtime error.

Special consideration should be taken to the fact that each DbDelete() operations decrements the RecCount() of the table. Because LastRec() is not direct supported by the ADS server traditional coding patters depending on LastRec()+1 are not possible. In addition, due to the Client/Server character in general the use of LastRec() to determine the highest record number used is invalid if the table is used shared.

ADT is ANSI only!

The ADT table format supports ANSI data only. Unfortunately the Advantage Database Server does not provide an fixed size binary datatype. Therefore it is not possible with ADT tables to store OEM data. If OEM data is stored data scambling/loss may occur.

Alaska Software strongly advise the developer to use SET CHARSET TO ANSI in all new projects. OEM charactersets are legacy and supported by Xbase++ only due to its Clipper compatibility.

Default value of ADT field is NULL

With ADT tables the default value of any field is NULL/NIL. This is a major difference to standard Xbase tables which use as a default value the empty value correspondig to the data type of the field. Therefore existing source code has to be reviewed and adapted to deal properly with NULL/NIL values.

If ADT tables in conjunction with an Advantage Data dictionary are used one can workaround that behaviour by properly setting up default values for each field or by explicit disabling NULL/NIL values for that field.

If free ADT tables are used, the SET NULLVALUE OFF setting of Xbase++ 1.9 and higher can be used to force the Xbase++ runtime to create a proper empty value if a field has a NULL/NIL value.

Empty date is not supported

With ADT tables it is not possible to store a empty date value. An empty date is represented by NULL/NIL when ADT tables are used.

Index and Filter versus SQL expression

By design Index and Filter expressions use a different expression engine than the SQL engine. As a consequence various ADS functions are only support by the SQL expression engine. This should be considered when forming Filter/Index expression or if using SQL statements such as Select.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.