Adding a Database Table

  1. On the Database Creation/Changes menu, select option 3 - Table editing.

  2. Enter up to 16 characters for the table name and confirm that you want to add the table to the database.

  3. Define the Table details, including the table heading and security access levels:

    Click on questions on the Table details entry screen for an explanation. The screen shot above is for releases up to 4.621. There are some changes in release 4.622. Please see the remarks below on Data Compression

  4. When you complete the Table Details, the Database Creation/Changes menu is redisplayed.

Data Compression

In the past data compression was not enabled by default. Although enabling data compression can, or perhaps could, cause performance problems in some circumstances, far more commonly we have seen situations where failure to turn compression on for high volume tables has caused significant problems to end users due to databases growing unexpectedly quickly. As of release 4.622 there is a new "Auto Compression" property, which is enabled for all tables by default. For all tables for which this flag remains set REORGDB reserves the right to turn data compression on or off, as it thinks best based on the data currently in the database. For databases where the "Enhanced Data Compression" facility is enabled, REORGDB may,and usually will, choose to use a different, and far more sophisticated compression mechanism, which typically improves on traditional DP4 compression by a factor of 3 or more.

If you don't want REORGDB to manage compression automatically for a particular table, then disable "Auto Compression". Such tables cannot be compressed using the new compression mechanism. This should not be a problem, since the only likely reason for disabling automatic compression management for a table is that you do not want it to be compressed.

Secret Options

The following additional options are displayed on the Table details screen, if you run MAKEDB with the -EXPERT or -BASEDICT command tail.

Do not create tables or fields with -BASEDICT unless you want them to be treated as part of the base dictionary. Such tables are not usually visible to applications and are not data independent.

Local table only

Enable this option if you are going to set up a distributed/networked database and want this table to be read and updated locally rather than on remote databases.

Non-unique keys

The default is 'No'. Enable this option if you want to be able to add several records with the same primary key. This may give improved update performance for tables such as order lines, but you will lose some of DP4's indexing capabilities and cannot use standard DP4 utilities such as BROWSER and PROGMAKE with these tables. This option is no longer supported (and has been completely removed as of release 4.622).

Pack fields

The default is 'No'. Answer 'Yes' to store data records without padding bytes

Only answer 'Yes' if you are confident of the effect of doing so; it may make it impossible for the data to be accessed with programs written in languages that enforce alignment restrictions. For database where enhanced data compression is enabled, enabling this option with the aim of saving disk space will have little or no effect, because padding bytes are normally compressible to a minute fraction of one bit.

Enable PHYS_INDEX

The default is 'No'. Enable this option to allow records to be fetched using the PHYS_INDEX index. While this increases the size of your database file and makes updates slightly slower, the PHYS_INDEX may provides faster access than the prime index and speed up database enquiries. This option has been removed in release 4.622

Additional length

This option is only applicable with the -BASEDICT command tail. It allows you to allocate up to 4000 bytes of data outside the normal DP4 fields. This data cannot be handled by standard DP4 utilities such as QA Build or BROWSER. It can be used to hold user-defined C programs or large character arrays defining bitmaps and so on. The maximum size of a table record is 4096 bytes, which means that the actual amount of additional data you can allocate is not 4000 bytes, but: 4096-<total_DP4_field_size>