Skip to main content

RELEASE

Releases record locks.

Synopsis

RELEASE [filevar [,recID]] [ON ERROR statements]

Arguments

filevar Optional — A file variable name used to refer to a MultiValue file. This filevar is supplied by the OPEN statement.
recID Optional — The record ID for which record locks are to be released. If not specified, all record locks and the file lock on filevar are released.

Description

A RELEASE statement with no argument releases all record locks held by the current process that were applied at the current @LEVEL execution level. (This differs from native UniData behavior, which releases all locks held by the current process on all levels.)

A RELEASE statement with the filevar argument releases all record locks on the specified MultiValue file held by the current process. A RELEASE statement with the filevar and recID arguments releases the record lock for the specified record on the specified MultiValue file held by the current process.

Records are locked using the RECORDLOCKU and RECORDLOCKL statements. You can check the status of record locks (and file locks) using the RECORDLOCKED function.

An update record lock is automatically released when you write data to the record using WRITE or WRITEV. The WRITEU and WRITEVU commands do not release the update record lock.

An update record lock is automatically released when you delete the record using DELETE. The DELETEU command does not release the update record lock.

CLOSE releases all record locks held on the specified file. ABORT and STOP release all record locks held by the current process.

A file is locked using the FILELOCK statement. RELEASE with no recID can be used to release a locked file. This is equivalent to issuing a FILEUNLOCK statement.

You can optionally specify an ON ERROR clause. If a record lock release fails, the ON ERROR clause is executed.

See Also

FeedbackOpens in a new tab