DISC

Contents | What's New | Quick Links

 

Omnidex Environments

Introduction

Software Installation

Concepts and Design

Designing Applications

Omnidex Environments

SQL Reference

Omnidex API's

Utilities

Interfaces

Performance Guide

Troubleshooting Guide

Appendix

 

 

Flat Files

 

Defining Tables | Defining Columns

 

In flat-file data management systems, the DATABASE statement identifies a logical grouping of related files. Declare a logical name to identify the set of files. You can name the database anything, as long as you don't use SQL reserved words or characters. It is best, however, to name the database something that describes the data it organizes. Declare the database type as FLATFILE.

ENVIRONMENT ORDERS

DATABASE "ORDERS"

TYPE FLATFILE

INDEXPREFIX "C:\omnidex\demodata\ordersix"

Flat Files

C-ISAM

POSIX Flat Files

Relational Databases

Oracle

Sybase

Informix

Database Specifics

Omnidex Environments

Syntax

 

Defining Tables

A flat-file database contains no underlying, native indexing system (such as Oracle or SYBASE), and therefore, no structured format. In data management systems that use flat files, the TABLE statement in the environment catalog provides the information that directs OmniAccess routines to physical files.

In flat-file data management systems, it is best to supply a logical name for the TABLE name and to identify the physical file in a PHYSICAL statement. Although you can declare a physical file specification in the TABLE name, you would have to enter the entire file specification whenever you referenced that table through an OmniAccess application. Assigning a logical name to TABLE and declaring the physical file in a PHYSICAL statement is a more efficient means of accessing data in flat files.

You can assign any logical name to TABLE, as long as you adhere to the naming rules outlined above. It is best, however, to supply a name that describes the data that is stored in the file. For example, if a file contains information about customers, name it "CUSTOMERS".

TABLE "CUSTOMERS"

PHYSICAL "c:\omnidex\demodata\customers.flat"

PARENT KEY "CUSTOMER_NO"

top

 

Defining COLUMNs

In data management systems that use flat files, declare a logical name to identify a particular area (field) common to records in the file you declared for TABLE. You can name COLUMN anything, as long as you adhere to the naming rules outlined in Defining TABLEs. It is best, however, to supply a name that describes the data that is stored in that area of the record. For example, if an area of each record in a file (table) is reserved for an order number, you might define the corresponding column as "ORDER_NO".

TABLE "ORDERS"

PHYSICAL "C:\omnidex\demodata\orders.flat"

CHILD KEY "CUSTOMER_NO" REFERENCES CUSTOMERS(CUSTOMER_NO)

CHILD KEY "PRODUCT_NO" REFERENCES PRODUCTS(PRODUCT_NO)

COLUMN "CUSTOMER_NO" DATATYPE INTEGER LENGTH 4
COLUMN "PRODUCT_NO" DATATYPE CHAR LENGTH 12
COLUMN "ORDER_DATE" DATATYPE CHAR LENGTH 6
COLUMN "STATUS" DATATYPE CHAR LENGTH 4
COLUMN "QUANTITY" DATATYPE INTEGER LENGTH 4
COLUMN "AMOUNT" DATATYPE INTEGER LENGTH 4

 

 

top

Dynamic Information Systems Corporation - Omnidex Version 3.8 Build 6 J15.03-Copyright © 2003

DISC | Documentation Home