Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ReadIsamData

ISAM read data at record position.

Short Name

REDIREC()

Type

ISAM function

Declaration

COUNT ReadIsamData(FILNO datno, LONG recbyt, pVOID recptr)

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

ReadIsamData() is the ISAM equivalent to the Low-Level function ReadData(). ReadIsamData() reads the data at record position recbyt for data file datno into the buffer pointed to by recptr. The significance of this function is that it decreases network traffic by eliminating the need to call ReadData() and SetRecord() to update the ISAM record buffers.

Return

Value

Symbolic Constant

Explanation

0

NO_ERROR

Successful read.

33

DNUL_ERR

recptr is NULL. No data file read performed.

36

READ_ERR

Operating system could not execute read.

42

DLOK_ERR

Could not get lock on data record. No data file read performed.

160

ITIM_ERR

Record deleted by another user.

See c-tree Error Codes for a complete listing of valid c-tree error values.

Example

FILNO datno;

LONG recbyt[16];

TEXT recptr[1024];


/* fill in an array of record positions */

FillRecordByteArray(recbyt);


/* read the 10th record in the array */

if (ReadIsamData(datno,recbyt[9],recptr))

printf("\nCould not read 10th record, error = %d",

isam_err);

else

printf("\nSuccessful record read at offset %ld",recbyt[9]);

Limitations

The recbyt parameter in this function is a 4-byte value capable of addressing at most 4 gigabytes. If your application supports HUGE files (greater than 4 gigabytes), you must use the ctSETHGH() and ctGETHGH() functions to set or get the high-order 4 bytes of the file offset. See also Record Offsets Under Huge File Support.

See also

ctSETHGH(), ctGETHGH(), ReadData(), SetRecord()

TOCIndex