Caché MultiValue Basic Reference
CLEARFILE
[Back] [Next]
   
Server:docs2
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Deletes all records from a MultiValue file.
Synopsis
CLEARFILE filevar [SETTING var] 
   [ON ERROR statements] [LOCKED statements]
Arguments
filevar A file variable name used to refer to a MultiValue file. This filevar value is supplied by the OPEN statement.
SETTING var Optional — When an error occurs, sets the local variable var to the operating system's error return code. Successful completion returns 0; error return codes are platform-specific. The SETTING clause is executed before the ON ERROR clause. Provided for jBASE compatibility.
Description
The CLEARFILE statement is used to delete all data from a MultiValue file. It does not delete the file itself. CLEARFILE takes the file identifier filevar, defined by the OPEN statement.
Caution:
CLEARFILE can delete large quantities of data. This data may be accessed by multiple processes.
To delete individual data records, use the DELETE statement.
You can optionally specify a LOCKED clause, which is executed if CLEARFILE could not delete all records due to lock contention. The statements argument can be the NULL placeholder keyword, a single statement, or a block of statements terminated by the END keyword. A block of statements has specific line break requirements: each statement must be on its own line; there must be a line break between the LOCKED keyword and the first line.
You can optionally specify an ON ERROR clause. If the data deletion fails (for example, the file could not be accessed), the ON ERROR clause is executed. The statements argument can be the NULL placeholder keyword, a single statement, or a block of statements terminated by the END keyword. A block of statements has specific line break requirements: each statement must be on its own line; there must be a line break between the ON ERROR keyword and the first line.
See Also