TOCPREVNEXTINDEX

AcuODBC User's Guide
Version 6.0

5.2.2 How Relational Databases Organize Data

Because SQL is designed to work with relational databases, you should understand the way relational databases organize data before attempting to write an ODBC program.

Even though AcuODBC gives you access to an indexed or relative file system, you will have to write SQL queries referring to "tables" and "columns." AcuODBC uses a data dictionary to convert COBOL data files into database tables that can be accessed with SQL statements. (Refer to section 6.1, "Data Dictionaries," for more information.)

In general, where COBOL manages data using files, databases manage data using tables. A table is composed of rows and columns. In the simplest case, each elementary data item in the record layout for a Vision file corresponds to one column in an SQL table. For example, a file with the following record layout:

    01  QA-RECORD.   
        05  CLIENT_ID         PIC 9(5).   
        05  OWNER             PIC X(30).   
        05  STREET            PIC X(30).   
        05  CITY              PIC X(30).   
        05  STATE_PROVINCE    PIC X(30).   
        05  POST_CODE         PIC X(6).   
        05  COUNTRY           PIC X(30).   

would be interpreted as the following table by AcuODBC if the file contained this data:

Each COBOL record can be viewed as a row of a table. In this example, each row contains a complete set of information regarding a single client. Columns specify the type of information we have gathered for each client.

However, COBOL permits certain conditions that database tables do not:

Even if you use some of the above-mentioned COBOL features that are not supported by the SQL table structure in your files, you may be able to access the file through AcuODBC by including special comments, known as directives, in your FD, as described in section 6.3, "Using Directives."


Acucorp, Inc.
Voice: (800) 262-6585 (U.S.A. and Canada)
Voice: (858) 689-4500
Fax: (858) 689-4550

Please share your comments on this manual
or on any Acucorp documentation with the
Acucorp Communications Department.
TOCPREVNEXTINDEX
1988-2003 Acucorp, Inc.
All rights reserved.