Chapter 2: Creating Tables


Overview

A table is a structured file that holds raw data about a particular subject. For example, you might have one table that contains information about customers and another table that contains information about sales.

Tables are organized by rows and columns. Each row contains information about one object. The customer table, for example, will contain one row for each customer. These rows are commonly referred to as records, but the terms are interchangeable.

A table may have zero or more records. A table with zero records is referred to as an empty table.

Each row in a table consists of one or more columns, with every row in a given table having the same number of columns. Each column is used to hold a particular piece of information about the subject associated with the table. For example, the customer table may have one column that holds the customer account number, and another column that holds the customer’s name, and so on. Columns are also referred to as fields.

Memo files are special files that hold a table’s variable-length binary data (binary, image, and memo fields in ADS). These types of fields are collectively referred to as BLOB (binary large object) fields. For example, your customer table may have a memo field used to hold a description of each customer. While some, or even all customer records may not have a description, whenever a description is present, it is stored in the memo file. With ADS tables, all binary, image, and memo fields for a particular table are stored in a single memo file. In addition, a table and its associated memo file (if present) have the same name. Only their file extensions differ.

In most cases, your application will reference the tables directly, but does not have to explicitly refer to any index or memo files. In most cases, ADS (Advantage Database Server) takes complete responsibility for accessing the indexes and memo files. For example, so long as you have only one structural index file for a table, any time you access that table through ADS, ADS opens the table, and opens its structural index and memo files, if present.

Note

The term “structural index” is originally a FoxPro term used to refer to the index file that has the same filename as its associated table. We have adopted that term to refer to any index file for an ADS table that has the same name as its associated table. While some people prefer to refer to these index files as “auto-open” index files, we feel that the term auto-open is less appropriate now that all of a table’s indexes are auto-opened when you access the ADS table through a data dictionary.




Advantage Database Server. The Official Guide
Advantage Database Server: The Official Guide
ISBN: 0072230843
EAN: 2147483647
Year: 2002
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net