Deletes one or more records from the specified file using the specified keys.
BOOL | LceDelete | (int | iSession, |
char far * | strFileName, | ||
char far * | strKeyList, | ||
BOOL | fValidate ) |
Parameters
iSession | The session identifier as returned by LceGetSessionId. |
strFileName | The name of the file. The file must have been declared using an LceUseFile function. |
strKeyList | A list of key field names. The keys must always be specified in the correct order. These fields must have been declared using the LceUseField function. |
fValidate | This parameter provides a "check but do not delete" facility, if you wish to check that a record can be deleted before you perform the actual delete. |
Return Values
TRUE is returned if the session can delete the record or has deleted the record.
FALSE is returned if an error occurs or the record does not exist.
Notes
When multiple users are working with a file, it is possible that two users will want to delete the same record. LANSA Open will handle this situation automatically if you leave the strKeyList blank. In this case, if a user attempts to delete a record which has already been deleted by another user, LANSA Open issues an appropriate message. Because LANSA Open does this check for you, record locking on the host is unnecessary.
- This function can only be executed after a session has been opened.
Tip
The LANSA Repository will perform referential integrity checks when deleting records, provided that you have added the relevant validation rules. For example, LANSA can check that a customer has no orders in the order file before allowing the customer record to be deleted from the customer file.
Related Functions
6.71 LceUseFile
6.58 LceSetFieldValue
6.59 LceSetFieldValueU
6.43 LceInsert
6.67 LceUnicodeToHex
6.8 LceCheckFor