Database Management Facilities

This section provides an overview of the various database management facilities supported by Reality.

Terminal Control Language

The Terminal Control Language (TCL) is the primary interface between the user and Reality. The TCL processor analyses each command entered at TCL and tries to match the first word with an item-id in the account's MD. If there is a match, the TCL processor formats the command string in a form that can be passed to the Reality processor, removing redundant blanks, and recognising and interpreting quoted strings and options. Depending on the command type, the command is passed to the appropriate Reality processor to be executed. If there is no match, an error message is displayed.

The following types of command can be entered at TCL.

Each type of command is defined by a different type of command definition item in the MD. The definition item contains a pointer to the Reality code that executes the command.

The TCL vocabulary in an account MD can be customised according to user requirements. Command definition items can be renamed or removed, and synonym definition items can be added. This is especially useful for restricting access to commands that might compromise database security. For example, some commands are only present in the SYSMAN account, or the SYSMAN and SYSPROG accounts. In addition, a maximum privilege level can be assigned to each user which prevents the user from executing privileged TCL commands. This restriction is set up using the SSM user-based security facility, discussed previously.

Commands can be entered in all upper or all lower case letters, but not in a mixture of the two. For clarity, all TCL commands in are shown in upper-case letters.

English Retrieval Language

English is a powerful inquiry language, used to access a Reality text file to retrieve information and typically to display a report. The English sentence is entered at TCL, with a pre-defined syntax.

An English sentence must commence with an English command. This must be followed by the name of the file to be accessed, optionally preceded by a 'file modifier', then by various optional phrases and clauses which specify the data to be retrieved and how it is to be organised and displayed at the terminal output. This may include specified attributes, item-ids, selection criteria, formatting clauses etc.

The English output is typically a report formatted in headed columns. English reports can be sent to the terminal screen, a printer or an application for processing.

The most commonly used English commands are LIST, SORT and SELECT. These, followed by a file-name, enable you to generate a straightforward report on a file, to produce a report in sorted order, or to select a subset of items for further processing. Around twenty further English commands are also supported.

English is a dictionary-driven language. The vocabulary available in an account is contained in the MD and can be tailored to a particular application's terminology. Data definition items, located in the file dictionary, define the data fields in a file's data sections and separately determine how data is processed before sorting or selection and before display or printing.

English can use an index to access a data section more quickly. The index name can be used explicitly to provide a list to the English command. Alternatively, an index is used implicitly when the index is appropriate for the English sentence, according to a defined set of rules. See File and File Index Management for details.

For a detailed description of English, refer to the English Reference.

DataBasic Programming Language

DataBasic is a significantly extended version of the original Dartmouth BASIC programming language and is the standard programming feature provided by Reality. It is an interactive, on-line, web-enabled, terminal-based language that includes all the main features of BASIC plus a range of additional features for the Reality environment. Web features include the RealWeb API, that generates web pages from data held in a Reality database; Remote Basic, that allows DataBasic routines to be called from Visual Basic and java, and as web services; and XML support, that allows DataBasic programmers to extract data from and export data to XML documents.

Refer to the DataBasic Reference for a more detailed description of DataBasic.

Proc: The Stored Procedure Language

Proc is an extended job control language which is typically used to execute batch jobs, or other scheduled activities. It can be used to link together a sequence of TCL commands, English sentences and DataBasic programs, stored in an item, so that they can be executed automatically in a pre-defined sequence by a single command. Its purpose is to act as a job control language, carrying out a complex series of operations with little or no user intervention.

Procs can also be interactive, prompting the user for input and optionally processing or verifying that input. Procs can also read and update files directly.

A Proc item is created, generally in a file reserved for Proc, using either the line Editor or the Screen Editor. A calling item is created in the account's MD which points to the Proc item, enabling it to be run from TCL. The Proc is run by entering the item-id of the calling item at TCL.

Refer to the Proc Reference for a detailed description of the Proc language.

TCL Macros

TCL macros allow users to perform simple batch tasks formed by combining TCL commands. Macros are items in the MD of an account and can be created with any of the Reality editors, or by saving commands from the TCL command stack.

Editors

Three text editing utilities are supplied: