Directives 

UPDATE

Update Existing Record in File

Format

UPDATE (chan[,fileopt])varlist

Where:

chan

Channel or logical file number of the file to which to write.

fileopt

Supported file options (see File Options):

BSY=stmtref 

Traps Error #0: Record/file busy

DOM=stmtref 

Missing record transfer

END=stmtref 

End-of-File transfer (File full)

ERR=stmtref 

Error transfer

IND=num 

Record index

KEY=string$/num

Record key

REC=name$

Record prefix where the name of the variable (rather than its contents) defines the prefix. (REC=VIS(name$) can also be used where the contents of the name$ variable defines the prefix.)

For more information on using the REC= option, see Prefixing Variables in an IOList via REC=.

RTY=num 

Number of retries (one second intervals)

SIZ=num 

Number characters to read

TBL=stmtref

Data translation table

TIM=num 

Maximum time-out value in integer seconds

stmtref

Program line number or statement label to which to transfer control

varlist

Comma-separated list of variables, literals, or IOL= options.

Description

The UPDATE directive is used to update an existing record to a file (logical file number/channel). The syntax for this directive is identical to the WRITE directive; however, UPDATE only updates a record if it already exists and will return an error if the record does not exist.

UPDATE may be used against keyed, memory, ODBC and OCI files. When IND= is used with *MEMORY*, this directive overwrites an existing index.

See Also

WRITE Add/Update Data in File
WRITE RECORD Write Record
INSERT Insert New Record in File