Product Documentation

FairCom RTG BTRV User Guide

Previous Topic

Next Topic

FairCom RTG SQL Access

FairCom RTG offers more than just a high-performance file system. The FairCom RTG SQL database engine opens a new and efficient method to access your data from many other applications via SQL. By avoiding the overhead imposed by many hybrid SQL implementations, FairCom RTG gives you the most direct access available.

Btrieve data files do not explicitly define a record schema, which is mandatory for SQL. If you want to provide SQL access to this data, you will need to define the record schema through an XDD (eXternal Data Definition) file. The XDD is an external XML file that is stored as a special resource within the data file created through the processes described in this chapter.

FYI: If your data file contains more than one record schema (REDEFINES), FairCom RTG provides an ability to define multiple record schemas, each of which will appear to SQL as a virtual table. See the FairCom DB API Virtual Tables technical white paper on the FairCom website.

The procedures in this chapter are optional: they are needed only if you want SQL access to your Btrieve data. There are two main parts to this process:

1) Create an XDD

First, you will define the record schema of your data with an XDD file. The method you will use depends on the compiler you are using:

  • Creating an XDD from a DDF: If you have a Data Dictionary File (DDF), you can generate the XDD from it using a ctutil option.
  • Creating an XDD Manually: If you do not have a DDF, you can manually create an XDD. Users of FairCom RTG BTRV who desire SQL access to their data will need to use these procedures.

2) Store the XDD in the data file and link it to the SQL dictionaries

  • Storing the XDD in the Data File: Next, you will store the XDD in the file and link it to the FairCom DB SQL dictionaries using a ctutil option.

Note: In some cases, these procedures will not produce the desired results because your data may be structured in a way that cannot be interpreted correctly. In those situations, you will need to add directives to your copybook to handle the data correctly or you can use the procedures in Creating an XDD Manually.

In This Chapter

Creating an XDD from a DDF

Create an XDD Manually

Storing the XDD in the Data File and Linking to the SQL Dictionary

Type Mapping Table

Troubleshooting Data Conversion Errors

Viewing Sqlized Tables in FairCom DB SQL Explorer

Adding SQL Indexes to Sqlized Files

ACUCOBOL API for SQL Conversion Error Checking

Background Information about Sqlizing Btrieve Data

TOCIndex