---
name: "PX_get_record2"
section: "3"
platform: "linux"
package: "pxlib-dev"
version: "0.6.9-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PX_get_record2"
---

# PX\_get\_record2(3)

Returns record in Paradox file

## NAME

PX\_get\_record2 — Returns record in Paradox file

## SYNOPSIS

\#include \<paradox.h\>

int PX\_get\_record2(pxdoc\_t \*pxdoc, int recno, char \*data, int \*deleted, pxdatablockinfo\_t \*pxdbinfo)

## DESCRIPTION

This function is similar to [PX\_get\_record(3)](/PX_get_record/3.md) but takes two extra  parameters. If \*deleted is set to 1 the function will consider any  record in the database, even those which are deleted. If \*pxdbinfo is  not NULL, the function will return some information about the data block  where the record has been read from. You will have to allocate memory  for pxdbinfo before calling PX\_get\_record2.

On return \*deleted will be set to 1 if the requested record is  deleted or 0 if it is not deleted. The struct pxdatablockinfo\_t has  the following fields:

- blockpos (long)

  File positon where the block starts. The first six bytes  of the block contain the header, followed by the record data.

- recordpos (long)

  File position where the requested record starts.

- size (int)

  Size of the data block without the six bytes for the header.

- recno (int)

  Record number within the data block. The first record in the  block has number 0.

- numrecords (int)

  The number of records in this block.

- number (int)

  The number of the data block.

This function may return records with invalid data, because records  are not explizitly marked as deleted, but rather the size of a valid data  block is modified. A data block is a fixed size area in the file which  holds a certain number of records. If for some  reason a data block has newer been completely filled with records, the  algorithmn anticipates deleted records in this data block, which are not  there. This often happens with the last data block in a file, which is  likely to not being fully filled with records.

If you accessing several records, do it in ascending order, because  this is the most efficient way.

**Note:**

**This function is deprecated.**  **Use [PX\_retrieve\_record(3)](/PX_retrieve_record/3.md) instead**

## RETURN VALUE

**Returns 0 on success and -1 on failure.**

## SEE ALSO

**[PX\_get\_field(3)](/PX_get_field/3.md), [PX\_get\_record(3)](/PX_get_record/3.md)**

## AUTHOR

**This manual page was written by Uwe Steinmann uwe@steinmann.cx.**
