UPDATE (XFILE)


9.0D

 

The UPDATE instruction allows a record to be partially or completely updated in place. The statement format is as follows:

 

[label]

UPDATE

{xfile};[[[{field}=]{var}][{listctl}]:

[,[[{field}=]{var}]|[{listctl}..]:

[;]

 

Where:

label

Optional. A Program Execution Label.

xfile

Required. A previously defined and opened XFILE variable in which data is updated.

field

Optional. The name of a field.

var

Optional. A previously defined Character String Variable, Numeric Variable, string or numeric ARRAY, or individual array element.

listctl

Optional. A supported list control.

;

Optional. indicates Partial I/O.

Flags Affected: OVER

Note the following:

  1. This instruction modifies the record associated with the last successful READ, WRITE, or REPOSIT operation.

  2. If the current file position is invalid, an I/O error occurs.

  3. {field} is an identifier for the field to the updated from the {var} variable. The syntax for {field} can be one of the following:

  4.  

    field name

    $field name

    @{svar} where {svar} is a variable that contains the field name

     

  1. If a $ precedes the field name, the $ character is stripped off and the field name references an attribute field.

  2. If no $ character precedes the field name, the field name references an element field or an attribute field.

  3. If no {field} is specified, the name of the {var} variable is the field name.

  4. No support for updating recordsets is available through update. The recordset must be access through a READ statement and modified using the other I/O statements.

  5. The supported {listctl} controls are as follows:

  6.  

    Control

    Function

    *LC

    Data is written in the case in which it was stored

    *LL

    Set the Length Pointer to last non-blank character

    *PL

    Disable *LL (default)

    *UC

    Convert lower-case data to upper-case

    *ZF

    Zero-fill numeric variables

    *ZS

    Blank-fill zero numeric variables

     

  1. Using a semicolon (;) as a terminator for partial I/O has no effect.

 

 

See Also: XML Support



PL/B Language Reference SETFILE (XFILE) WRITE (XFILE)