Embedded Database Filenames & Extensions
This page discusses the file names and file name extensions used for the embedded (DataFlex) database. See Development File Names & Extensions for information regarding file names and extensions for DataFlex programming-related files.
A DataFlex embedded table is stored as a group of disk files sharing a common root name in the directory. For example, an embedded database customer table would consist of:
Customer.datCustomer.tagCustomer.hdr(if header integrity checking is enabled)Customer.k1Customer.k2Customer.k??(one for each index in the Customer table)Customer.vld(if compression is used)Customer.fd
The files that make up a table are distinguished by their names and extensions, which are described below. Below each file or file type is a section that specifies whether the file is required for:
- Compilation
- Application Deployment
- Embedded Database
- Non-Embedded Database (any database back-end besides embedded database)
Corrupted Data File (*.BAD)
A file named rootname.BAD is created if duplicate records or other data corruption is found during the reindexing (repairing) of the embedded database. The "bad" data in a .BAD file can be "cleaned out" using Database Builder.
Required for:
- Compilation: No
- Application Deployment:
- Embedded Database: No
- Non-Embedded Database: No
Filelist.cfg
DataFlex maintains a list of tables in a special file called (by default) Filelist.CFG.
Required for:
- Compilation: No
- Application Deployment:
- Embedded Database: Yes
- Non-Embedded Database: Yes
See Also: The Filelist, Database API attributes DF_File_Root_Name, DF_File_Physical_Name, DF_File_Logical_Name
The Data File (*.DAT)
Every database table has a file whose name is rootname.DAT. This file is typically the largest of the file set (unless the data is compressed — see Compressed Data File (*.VLD) below), and it contains the actual data of the database table (again, unless data is compressed). It contains very little besides data. The file does not contain any characters separating one column from another, nor even one row (record) from another. It does not even contain RECNUMs (record identifiers) — records are found and identified by the number of bytes away they are from the beginning of the file's data. .DAT files do contain a section, called the "header", at the beginning identifying the number of records in the table, the order, lengths, and types of the columns, and so on. Some of this data may be considered Record 0 of the file, but it cannot be accessed or displayed in the manner of data in an actual row.
Required for:
- Compilation: No
- Application Deployment:
- Embedded Database: Yes
- Non-Embedded Database: No
See Also: Database API attribute DF_File_Integrity_Check
Header File (*.HDR)
Each DataFlex table has an option called Header Integrity Checking. If this option is used for a database table, a file named rootname.HDR will be created. This file is modified whenever a row is deleted or saved, or the database's definition is changed. If the header data (contained in the .DAT file) becomes corrupted, the .HDR file is required to repair it.
Required for:
- Compilation: No
- Application Deployment:
- Embedded Database: Yes
- Non-Embedded Database: No
See Also: Database Builder, Structure_Start, Structure_End, Database API attribute DF_File_Integrity_Check
Index Files (*.K##)
The great majority of database tables have one or more indexes, up to a maximum of 15 (in the embedded database). A table that has one index includes a file whose name is of the form rootname.K1. A table with two indexes would have rootname.K1 and rootname.K2, and so on if there were more indexes. These files contain the key value for the index of every record, along with the record number for each. When a table has many indexes with long keys, the aggregate size of the index files can exceed that of the .DAT file.
For any given index to be usable at run time, the pertinent .K## file must be present. If an index file is in a directory other than the directory of its .DAT file, the other directories in the Data registry key will be searched for the file. When an index is being created (or reindexed), it will be created in the directory of the .DAT file unless a predecessor version is found in a (different) Data directory.
Required for:
- Compilation: No
- Application Deployment:
- Embedded Database: Yes
- Non-Embedded Database: No
Log File (*.LOG)
Log files are created by Database Builder during numerous operations, such as repairing tables and conversion to various database back-ends. Log files are also created by the DataFlex Web Application Server.
Required for:
- Compilation: No
- Application Deployment: No
DataFlex Repair Wizard Backup File (*.ORG)
A file named rootname.ORG is created by the "DataFlex Repair Wizard". This wizard can be started in Database Builder from the Maintenance menu under the 'Repair Wizard' option.
Required for:
- Compilation: No
- Application Deployment: No
Column-Name File (*.TAG)
The names of the columns of a table are kept in a file whose name is rootname.TAG. These column names are required for Table Editor and other tools. This is an ASCII file, and it can be edited, but doing so is not generally recommended. If you wish to discourage browsing or modification of a table, you may remove its .TAG file, as the database manager does not require it for accessing a database table. This file is not needed for tables that do not use the embedded database.
Required for:
- Compilation: No
- Application Deployment:
- Embedded Database: No (not required, but typically desired)
- Non-Embedded Database: No
Compressed Data File (*.VLD)
If compression is elected for a database table, its data is kept in a file named rootname.VLD. When this is done, the .DAT file becomes a small fraction of its former size and contains only pointers into the .VLD file. The .VLD file also is typically a great deal smaller than the .DAT file was, or would have been, even in combination with the new, shorter form of .DAT file that is used with compression.
Required for:
- Compilation: No
- Application Deployment:
- Embedded Database: Yes
- Non-Embedded Database: No