URL: http://www.firstbasesoftware.com/man/man5/ddict.htm
Last modified: 12 September 1995
Copyright © by FirstBase Software.
[
Index of Contents] [
FirstBase RDBMS Overview]
Formally, this file, called a ddict file, is edited using the dbdbas(1) tool. All FirstBase tools use this file at run time to determine the layout of the database being used or created.
This manual page describes the layout of database dictionary files so that creation of theses files can be accomplished using a text editor or program of some kind.
Warning: dbdbas(1) allows only limited changes to a ddict file after a database has been created. In general, this rule should be followed by those who want to edit ddict files by hand.
However, if you know what you are doing, using a text editor on a ddict file can save lots of time during the design phase of application development, and can also be used on a working system without disturbing the data. As a rule, use dbcheck(8) with the -clp flags after the modifications to ensure a match between the data dictionary and data records.
Each field descriptor is on a line by itself, with each attribute separated by white space. The optional attributes are represented as switch settings and are defined on a field by field basis. The following represents an entire field attribute in BNF notation, with detailed descriptions below. (Though shown on two lines, each entry must be a single line).
Field_Name Field_Type Field_Size [-d default] [-c[ab] comment] [-l]
[-h helpfile] [-A] [-a[u] autoindex] [-r range] [-m macro]
Note that if no default is defined, the field becomes a FORCED ENTRY field, and users will not be able to add a new record without this field having information in it. Also, to use a "blank" as the default, use the underscore, as in "-d _".
One special use of the default attribute is for link fields. The link address, as discussed in dbdbas(1), is stored in this attribute.
Another special use of the default attribute concerns the precision of formula and float data types. The precision, or the number of decimal places, is specified by appending a :N to the default string, where N is the desired precision. The default precision is two.
The comment flag is a -c, optionally followed by an a (after) or a b (before). The comment flag is followed by the actual comment text.
Note that full path names are not needed. When invoked from a distance, FirstBase tools will properly prepend the working directory to the helpfile if needed.
Alternately, the helpfile is used as a choicefile for data fields of type c (choice), C (silent choice), and X (Extended Choice). Choice files are outlined in choice(5) and xchoice(5).
An additional feature allows standard choice types (c and C) to have choice files that dynamically grow during the editing session. This feature is enabled using the -A flag.
An autoindex is a standard FirstBase index, but a very simple one. These indexes must be single field indexes, and must select ALL entries. The needed index dictionaries will be created automatically when a database editor is invoked. However, they can be created using dbdind(1) as well as long as the above rules are followed.
A unique values flag can be combined with the autoindex flag, and is denoted as -au. This flag will make the database editor enforce unique values for all values entered into the associated field.
Along the standard UNIX method, range strings are made up of single elements separated by commas. Each element is either a single value, or an element of the form M-N which covers all numbers or characters in the range M through N. For example, -r 7,9,31 and -r a-j,o,p,w-z are both valid range specifiers.
Also, data types can be changed by hand if the user is sure of the data within the fields. For example, an A could be converted to an a, but the reverse might not hold true. There is no real difference in how the fields are stored, so conversion is generally alright. New records will be handled correctly, as well as modifications to old records.
Changing the size of a field by hand is also acceptable. In fact, increasing the size of a field will always work. However, decreasing the size must be done carefully. If you know that all the data in a certain field is less than 50 characters wide, yet its defined maximum is 75, changing it to 50 will not hurt anything. Again, dbcheck(8) with the -clp flags is a good sanity check after making direct changes to a ddict file.