1.2. Interchange Database Conventions
This section describes naming and file usage conventions used with Interchange.
Note: Throughout the documentation, the following terms and their definitions are used interchangeably:
A reference to the database key. In Interchange, this is usually the product code or SKU, which is the part number for the product. Other key values may be used to generate relationships to other database tables.
It is recommended that the key be the first column of the ASCII source file, since Interchange's import, export, and search facilities rely on this practice.
The vertical row of a database. One of the columns is always the key and it is usually the first one.
A table in the database. Because Interchange has evolved from a single-table database to an access method for an unlimited number of tables (and databases, for that matter), a table will occasionally be referred to as a database. The only time the term database refers to something different is when describing the concept as it relates to SQL, where a database contains a series of tables. While Interchange cannot create SQL databases, it can drop and create tables with that database if given the proper permissions.
If necessary, Interchange can read the data to be placed in tables from a standard ASCII-delimited file. All of the ASCII source files are kept in the products directory, which is normally in the catalog directory (where catalog.cfg is located). The ASCII files can have ^M (carriage return) characters, but must have a new line character at the end of the line to work. NOTE: Mac users uploading files must use ASCII mode, not binary mode.
Interchange's default ASCII delimiter is TAB.
Note: The items must be separated by a single delimiter. The items in this document are lined up for reading convenience.
Fields are separated by ^I characters. No whitespace is allowable at the beginning of the line.
code description price image SH543 Men's fine cotton shirt 14.95 shirts.jpg
Fields are separated by pipe | characters. No whitespace is allowable at the beginning of the line.
code|description|price|image SH543|Men's fine cotton shirt|14.95|shirts.jpg
Fields are enclosed in quotes, separated by commas. No whitespace should be at the beginning of the line.
"code","description","price","image" "SH543","Men's fine cotton shirt","14.95","shirts.jpg"
Note: Using the default TAB delimiter is recommended if you plan on searching the ASCII source file of the database. PIPE works fairly well, but CSV delimiter schemes might cause problems with searching.
IMPORTANT NOTE: Field names are usually case-sensitive. Use consistency when naming or you might encounter problems. All lower or all upper case names are recommended.
Interchange uses one mandatory database, which is referred to as the products database. In the supplied demo catalog, it is called products and the ASCII source is kept in the file products.txt in the products directory. This is also the default file for searching with the THE SEARCH ENGINE.
Interchange also has a two of standard, but optional, databases that are in fixed formats:
The database of shipping options that is accessed if the CustomShipping directive is in use. This is a fixed-format database, and must be created as specified. For more information, see the Shipping ITL tag in the Interchange Tag Reference Guide.
The database of sales tax information if the [salestax] tag is to be used. A default is supplied. NOTE: Caution, these things change! This is a fixed-format database, and must be created as specified. See Sales Tax.
These are never stored in SQL or DBM.