Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

DeleteKeyBlind

Delete key value when associated data record position is not known.

Short Name

DELBLD()

Type

Low-Level index file function

Declaration

LONG DeleteKeyBlind(FILNO keyno, pVOID target)

Description

In V12 the file number typedef was formally changed from COUNT, a two-byte value to FILNO, a four-byte value. Refer to this link for compatibility details. Four Byte File Numbering

DeleteKeyBlind() deletes the key value pointed to by target from index file keyno, if such a key value exists. DeleteKeyBlind() cannot be used when the index file supports duplicate keys.

Return

If the key value is found in the index, it is deleted and DeleteKeyBlind() returns the associated data record position. If it is not found, or some error is detected, DeleteKeyBlind() returns a zero (which is never a legal data record position), and uerr_cod is set as follows:

Value

Symbolic Constant

Explanation

0

NO_ERROR

Successful deletion.

4

KDEL_ERR

Cannot find key value to delete.

5

KBLD_ERR

Cannot call DeleteKeyBlind() when duplicate keys are supported.

See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.

Example

LONG recbyt;

FILNO keyno;

TEXT target[24];


keyno = 1;


printf("\nEnter key value: ");

scanf("%23s",target);

if (recbyt = DeleteKeyBlind(keyno,target))

printf("\n%s deleted (data record position = %ld).", target,recbyt);

else

printf("\nUnsuccessful deletion (code = %d).",uerr_cod);

Limitations

Cannot be used with an index supporting duplicate key values. Without knowledge of the associated data record position, there is no way to distinguish among identical key values.

See also

DeleteKey

TOCIndex