This command allows the user to create a new
(empty) database and to specify its size in terms of the approximate
number of datasets to be stored. The new database may be given a title
and/or protected by a password. In addition its name may be added to
the MTDATA database configuration file. It will then appear on the list
of active databases in subsequent MTDATA sessions as well as on the
list held in memory during the current session.
password = <""> (A blank password gives no database protection)
title = <""> (No default title is given to a database)
||update = no
create database="mydata" !
cre dat="slag" update=yes title="Data for slags - 12/3/93" !
cre data="projectx" password="XYZ123" !
cr da="minidata" title="A small database" estimate 10 !
creat data="maxidata" title="A big database" est 1000 !
value <"database name">
Following the DATABASE parameter the user
is expected to provide, in quotes, the name of the database to be
created. No database of this name should already exist.
PASSWORD takes the value
parameter allows a password to be assigned to any new database. The
chosen password should be specified in quotes. The contents of a
password protected database cannot be listed out using the LIST_DATA
command unless the correct password is given. If the PASSWORD parameter
is not used in creating a new database, or a blank password is chosen,
the database will NOT be password protected.
TITLE takes the value <"database title">
parameter allows the user to assign a title to any new database. The
desired title should be specified in quotes. The titles of all
databases active during any MTDATA session can be inspected by invoking
the STATISTICS command (see STATISTICS). Database titles should NOT
contain the character "|" (a vertical line) as this may result in the
database being inaccessible unless specifically authorised in the
MTDATA permit file.
ESTIMATED_DATASETS takes the value <number>
The ESTIMATED_DATASETS parameter allows
the user to specify the size of a new database to be created in terms
of the approximate number of data items to be stored. If too small a
number is given then the database file will be increased in size as
necessary during the data loading process. If too large a number is
given then some space will remain unused within the database file. The
process of data loading and storage is most efficient if a reasonably
accurate estimate is given for the number of datasets to be stored. By
default zero is taken.
UPDATE takes the values YES/NO
The UPDATE parameter is
used to add the name of a new database to the MTDATA database
configuration file (mtconfig.txt). This file contains an integer n
followed by a list of databases, the first n of which are made
available for use (or made "active") at the start of every MTDATA
session. Any newly created database is added automatically to the in
memory list of active databases (see STATISTICS command) but will only
be available for use in subsequent MTDATA sessions if the database
configuration file is UPDATEd. New databases are added at the (n+1)th
position in the configuration file. All existing databases beyond this
point therefore move down one place in the list.
YES is used to update the
MTDATA database configuration file with the name of a new database
about to be created. For the UPDATE to be successful the user must have
permission to write to the mtconfig.txt file and this file must exist
in the directory from which MTDATA is being run (the current directory).
NO is used to request that the MTDATA database configuration file is not updated.
When the CREATE_DATABASE command is
executed, the new (empty) database that is set up takes the form of two
separate files. These files are given the extensions .dbs and .inx.
They correspond to the database file itself and the database index file
respectively. Deleting either file will destroy the database. It is
important that .inx and .dbs files are NOT copied between different
computer operating systems.
There are four main types of error which may be encountered in creating a new database:
(a) A database (specifically an .inx
file) with the same name already exists. This database may or may not
appear on the list of databases currently active. An error message is
issued as follows:
FILE ALREADY EXISTS PLEASE GIVE A NEW NAME
The simple remedy is to choose a different name for the new database.
Alternatively the old (existing) database could be deleted if no longer
required or renamed by modifying the names of the appropriate .inx and
.dbs files along with their matching entry in the database
configuration file (mtconfig.txt).
(b) The maximum number of active databases is reached. An error message is issued as follows:
DATABASE CLOSED TOO MANY ON CURRENT LIST
A new database (.inx and .dbs files) is created but does not appear on
the list of databases currently active. The user should terminate the
current MTDATA session, edit the database configuration file
(mtconfig.txt) to replace the name of an old database with that of the
new one (or add the new name at the top of the file) and then reload
(c) No mtconfig.txt file was found when MTDATA was loaded. An error message is issued as follows if UPDATE=YES is used:
FILE CONTAINING DATABASE LIST NOT FOUND
A new database (.inx and .dbs files) is created and
appears on the active list. There is no mtconfig.txt file to update.
(d) The mtconfig.txt file is write protected. An error message is issued as follows if UPDATE=YES is used:
ERROR IN OPENING FILE CONTAINING DATABASE LIST
A new database (.inx and .dbs files) is created and
appears on the active list. The database configuration file
(mtconfig.txt) is not changed.