File Definition Item

A file definition item, located in an account's MD, defines the location and characteristics of a file. It points to the file dictionary, giving system information in attribute 2, which specifies the location of the file in the host system, and file creation parameters in attribute 3. It also defines retrieval and update lock codes in attributes 5 and 6, and English formatting characteristics in attributes 7 to 10.

Item format

Attribute Description
Item-id

File name.

  001

D {I} {L||R} {C} {T} {X|Y}

where:

  • D - Marks a Definition Item.

  • I - Specifies that the file contains case-insensitive item-ids.

  • L - Specifies that the file is to be logged by Transaction Logging. This is the default setting when a file is created.

  • R - Specifies that the file is not logged by Transaction Logging, but that its data will be recovered during the automatic recovery of a database configured for Rapid Recovery.

  • C - Specifies that the dictionary or file contains or has contained compiled DataBasic programs. Added when you compile a program.

  • T - Specifies that the file does not take part in transactions. As a result, if a transaction is aborted, the changes will not be rolled back. It is recommended that this code is used for application log files.

  • X - Specifies that the file will be excluded from logical saves.

  • Y - Specifies that the SAVE command will save only D-pointers (data level descriptors). When restored the file will be empty.

Note

  • For more information on the logging status of files, refer to the description of the TL-SET-LOG-STATUS command.
  • The O option to the SAVE command overrides the X and Y codes.
  • If X and Y are both specified, the file will always be excluded from logical saves; this cannot be overridden.
  002

On a Partition Database:

start , modulo id , id

where:

  • start - This is the logical block number of the start of file dictionary.

  • modulo - This is the modulo of the file dictionary.

  • id - This is the reuse identifier.

OR, on a Filestore Database:

The UNIX path name of the file dictionary.

OR, for a file on a Foreign Database:

n ; TableName

where:

  • n - This is a number indicating which version of the access method created the file.

  • TableName - This is the name of the SQL table on the foreign database created to hold this Reality file.

OR, for a directory view or special file:

Empty.

003

File creation parameters. The first character specifies the file type (see below) and the second is always '2' (file dictionary). Subsequent characters depend on the file type.

For a normal file on the Local Database:

File creation parameters - B2 modulo,1 (for example, B2 7,1).

where:

  • B - Specifies a normal Reality file.

  • modulo - The modulo of the dictionary.

OR, for a file on a Foreign Database:

F2 dsn, {userId}, {password}

where:

  • F - Specifies a file on a foreign database.

  • dsn - The ODBC Data Source Name for the foreign database. The Data Source Name may itself include a user-id and password. For information on how to set up Data Source Names, refer to Setting-up the SQL/ODBC Data Source in SQL for Reality.

  • userId - The user-id for connecting to the foreign database.

  • password - The password associated with userId (encrypted).

004

File trigger information. This is a subvalued list of trigger subroutine names in the order PRE-WRITE, POST-WRITE, PRE-DELETE, POST-DELETE.

005

Optional. Retrieval lock code(s).

006

Optional. Update lock code(s).

007

Optional. Conversion codes for English to display item-ids.

008

Optional V (sublist) code for English.

009

Mandatory. Contains a code specifying the type of alignment to be used by English. Must be one of the following:

  • L - Left aligned.

  • R - Right aligned.

  • T - Text aligned. Text wraps at word boundaries.

  • U - Unlimited.

Note

For more details, refer to the topic Data Definition Item.

010

Maximum width of item-id column. Defaults to 10 when the file dictionary is created.

011

Not used and reserved.

012

Null.

013

Optional. Reallocation parameters. At the next restore from a FILE-SAVE, the file dictionary is allocated the new modulo and separation parameters specified here.

The format of this specification is (modulo, separation), where modulo is the new modulo expressed as a decimal integer (separation is always 1 on the current version of Reality).

014 - 020

Reserved.

See also

File Synonym Definition Item.