Product Documentation

FairCom ODK Driver

Previous Topic

Next Topic

RecordRead

Reads a record from a table using a Primary Key on an IO Channel.

void FCODKDriver::RecordRead(const char *tableName, const char *pk, unsigned long *valueLen, void *valueBuffer)

Parameters:

  • IO Channel Number - See TableCreate.
  • tableName [IN] - See TableCreate.
  • pk [IN] - Primary Key:

    If the value is less than the Primary Key Length, the byte following the end of the value must be set to NULL.

    If the value equals the Primary Key Length, then the NULL character does not and cannot exist at the end.

    Primary Key value can be NULL.

  • Invalid Value Error Conditions:
    • None

Result Values:

  • valueLen [OUT] - Record Value. A fixed-length buffer of bytes. Value length populated in the provided buffer. FairCom Edge puts the bytes stored in the record into this buffer.
  • valueBuffer [OUT] - Record Length. Value buffer populated with the record data. The number of bytes stored in the record value.

    It can be less than Record Value’s fixed-length buffer.

    It is a four-byte unsigned integer number between 1 and 4,294,967,296‬.

Expected Errors:

  • A record with the specified Primary Key Value does not exist.

When an Error Occurs:

  • Driver sets the Record Value to NULL.
  • Driver sets the Record Length to NULL (i.e. zero length).

TOCIndex