UPDATE.RECORD

UPDATE.RECORD

Top  Previous  Next

 

UPDATE.RECORD simplifies amendment of database files. In batch mode, it allows the same update to be made to multiple records in a file with just one command, possibly changing the content of more than one field. In visual mode, it displays a full screen image of fields from the data record in their external (converted) form, allowing modifications to be entered as the cursor is moved around the displayed data.

 

 

Format

 

UPDATE.RECORD {DICT} file {USING {DICT} dict}

FROM listno

ALL

id { id ...}

INQUIRING {prompt}

 

Batch mode:

field,value {CONV "spec"} { field,value ...}

DELETING field

{COUNT.SUP}

{VERIFY.SUP}

{EXCLUSIVE}

{WAIT}  or  {NO.WAIT}

{CREATING}

{OVERWRITING}

{REPORTING}

{LPTR {n}}

{NO.PAGE}

 

Visual mode:

{ID.SUP}

{COL.SUP}

 

Identifying the file to be processed:

 

{DICT} filespecifies the file to be updated. The optional DICT keyword indicates that the dictionary portion of the file is to be updated.

 

USING {DICT} dictspecifies that dict is to be used as the dictionary for file. The optional DICT keyword uses the dictionary portion of dict.

 

 

Selection of the records to be updated:

 

FROM listnospecifies that select list listno (0 to 10) is to be used as the list of records to process.

 

ALLspecifies that all records in file are to be updated. UPDATE.RECORD will use select list 0 internally to generate the list of records to be processed.

 

id { id ...}is a list of specific record ids to process. Record ids should be enclosed in single or double quotes if they contain spaces or commas or match command keywords.

 

INQUIRING {prompt}causes UPDATE.RECORD to prompt for the id of each record to be processed. The prompt string is optional and must be enclosed in single or double quotes if it contains spaces or commas. If omitted, a default of "Record id" is used. Inquiry mode is the default in visual mode if no record ids are specified and the ALL and FROM keywords are not used.

 

Only one of these selection styles can be used in a single command. If none of the above record selection criteria is given and the default select list is active, that list is used.

 

 

Specifying the updates to be made in batch mode:

 

fieldidentifies the field to be updated. The value given may be a numeric field position or the name of an A, D or S-type item from the dictionary.

 

valueidentifies the new value to be placed in field. This may be a number, a quoted string, the name of a field or I-type from the dictionary or the keyword EVAL followed by an I-type expression in either single or double quotes.

 

CONV "spec"Allows use of a non-default conversion code.

 

DELETING fieldDeletes the specified field from the data record, moving all subsequent fields back by one position.

 

 

Options controlling the action of UPDATE.RECORD in batch mode:

 

COUNT.SUPsuppresses the normal report of the number of records processed.

 

VERIFY.SUPsuppresses the confirmation prior to an update using a select list or the ALL keyword.

 

EXCLUSIVEcauses UPDATE.RECORD to lock the entire file during the update to ensure exclusive access. If the file cannot be locked, UPDATE.RECORD will display a message and terminate unless the WAIT keyword is also given, in which case it will wait until it can obtain exclusive access.

 

WAITcan be used with the EXCLUSIVE keyword as described above. It can also be used alone to specify that UPDATE.RECORD should wait whenever it encounters a locked record.

 

NO.WAITturns off WAIT. It is not normally required as this is the default. UPDATE.RECORD honours the last WAIT or NO.WAIT on the command line.

 

CREATINGcauses UPDATE.RECORD to create records that are not found in the file.

 

OVERWRITINGallows overwriting of existing records when changing the record id.

 

REPORTINGproduces a detailed report of each update.

 

LPTR {n}directs the commentary from UPDATE.RECORD to the specified print unit. Print unit 0 is used if n is omitted.

 

NO.PAGEsuppresses pagination of output to the display.

 

The sequence of the command components must be file specification, record ids, fields and values, options.

 

 

Options controlling the action of UPDATE.RECORD in visual mode:

 

ID.SUPsuppresses display of the field names.

 

COL.SUPsuppresses display of the display names (column headings in a query report).