The information contained in the XDD is stored directly in the data file itself with no effect on Btrieve access to the data. The XDD file is embedded into the data file using the ctutil ‑sqlinfo switch. After adding the XDD information to the data file, the ctutil ‑sqllink switch is used to make it immediately accessible through SQL.
Any operation performed through SQL or from the application uses and maintains existing indexes for optimal performance. Because of the nature of some Btrieve types encoding, a native RTG index may not sort as an SQL expects. FairCom DB SQL can still take advantage of these indexes to retrieve records while not using them for sorting. This architectural limitation does not have significant impact in practice because the SQL engine is able to build temporary index files on the fly when necessary and uses dynamic index techniques. In addition, SQL specific indexes can also be created and are fully compatible with both SQL and original RTG application usage.
An interesting feature available with FairCom RTG is the ability to have multiple record schemas in the same data file.
A common programming technique for optimizing memory and storage was to combine multiple schemas into a single data file or table. Depending on some criteria, each record was interpreted using a particular application specific schema. This technique is a standard COBOL feature using REDEFINES. This, of course. contradicts strict relational requirements of SQL schemas. FairCom addresses this challenge by virtually presenting each application specific schema as a separate SQL table. This is accomplished by indicating in your data schema definition your same application specific rule determining which table each record resides. FairCom RTG does the rest.
Select statements on one of these virtual tables display only records matching the selected criteria. Inserts into these tables are checked for matching criteria.
See Also
View the FairCom DB API Virtual Tables technical white paper on the FairCom website for the advanced FairCom database technology that makes this seamless support possible.