Data type: File/Record

The File/Record data type is a compound data type represented by the number 6 in the database dictionary. A file is a set of related records treated as a single unit and is stored on disk. A file is a particular kind of structure, but a structure is not a kind of file.

The term file is synonymous with the terms relation or table and is sometimes used interchangeably with the term table because of the legacy file system (P4) in the product (ServiceCenter / Service Manager).

Every table must have a table name and other descriptive data in the database dictionary. For example, the name of the contacts table is contacts. The contacts table has keys, fields with index numbers, and a descriptor. Table variables are the mechanism you use to make changes to tables. Always create table variables on the rinit command panel. The table variable stores one record at any given point in time. The record resides in memory for display or modification. For additional information, see the Database Management section in the Service Manager Help Center documentation.

File variables

A file variable is an instance of a single record in a file. It is not an array, but it is conceptually similar. A file variable contains the dbdict name, the data, and the structure of an entire record as it would be stored in the database according to the dbdict. A file variable has four parts:

  • File name in the database dictionary The RAD Database Manager requires this to be a single word without spaces or periods. The rinit command panel binds the file variable to a file. The file name of a file variable can be accessed either by using the pseudo field or using the filename() RAD function.
  • List: records selected from the file When executed, a select command panel retrieves the file’s records from the database and sets up the list. When executed, a fdisp (File Display) command panel displays summary information from records in the list.
  • Current record A file variable can only contain one record from a file at a time. You can move to the next record in the list of records by using the next command panel (Read Next Record). You can move to the previous record in the list by using the previous command panel (Read Previous Record). The select command panel always sets the current record to the first record that satisfies the selection query. The fdisp (File Display) command panel sets the current record to the record selected by the cursor when the user presses Enter.
  • Descriptor The descriptor enables fields to be extracted by name. Each record is a structure and has the structure delimiter {[ ]}. The field names in the structure are listed in the database dictionary.

For example:

  • $file is a file variable.
  • lastname is a field name listed in the database dictionary for the file that $file has been bound to using the rinit command panel.
  • lastname in $file is a valid expression whose value is the lastname field in the current record in $file, or the nth field, based on the index of the lastname field in the descriptor.

Note Service Manager is case sensitive. The case for field names, file names, and other elements must match. For example, STATUS.CUST is not the same as status.cust.