Btrieve 2
Loading...
Searching...
No Matches
BtrieveBulkRetrieveResult Class Reference

The Btrieve bulk retrieve result class. More...

#include <btrieveCpp.h>

Public Member Functions

 BtrieveBulkRetrieveResult ()
 
 ~BtrieveBulkRetrieveResult ()
 
Btrieve::StatusCode GetLastStatusCode ()
 Get the last status code.
 
int GetRecord (int recordNumber, char *record, int recordSize)
 Get the record.
 
int GetRecordCount ()
 Get the record count.
 
long long GetRecordCursorPosition (int recordNumber)
 Get the record cursor position.
 
int GetRecordLength (int recordNumber)
 Get the record length.
 

Detailed Description

The Btrieve bulk retrieve result class.

Examples
bfilter.cpp, and btestbulk.cpp.

Constructor & Destructor Documentation

◆ BtrieveBulkRetrieveResult()

BtrieveBulkRetrieveResult::BtrieveBulkRetrieveResult ( )
Snippet
C++ btestbulk.cpp
BtrieveBulkRetrieveResult btrieveBulkRetrieveResult;
Python btestbulk.py
btrieveBulkRetrieveResult = btrievePython.BtrieveBulkRetrieveResult()
assert(btrieveBulkRetrieveResult != None)

◆ ~BtrieveBulkRetrieveResult()

BtrieveBulkRetrieveResult::~BtrieveBulkRetrieveResult ( )

Member Function Documentation

◆ GetLastStatusCode()

Btrieve::StatusCode BtrieveBulkRetrieveResult::GetLastStatusCode ( )

Get the last status code.

Note
This method is intended for use following methods which don't return a status code.
Snippet
C++ btestbulk.cpp
// If GetRecord() fails.
if (btrieveBulkRetrieveResult.GetRecord(1, (char *)&record, sizeof(record)) != sizeof(record))
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecord():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btestbulk.py
rc = btrieveBulkRetrieveResult.GetRecord(1, record)
assert(rc == recordLength), "Error: BtrieveBulkRetrieveResult::GetRecord():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveBulkRetrieveResult.GetLastStatusCode()))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bfilter.cpp, and btestbulk.cpp.

◆ GetRecord()

int BtrieveBulkRetrieveResult::GetRecord ( int recordNumber,
char * record,
int recordSize )

Get the record.

Note
This method doesn't return a Btrieve::StatusCode. See below for more information.
Parameters
[in]recordNumberThe record number.
[out]recordThe record.
[in]recordSizeThe record size.
Snippet
C++ btestbulk.cpp
// If GetRecord() fails.
if (btrieveBulkRetrieveResult.GetRecord(1, (char *)&record, sizeof(record)) != sizeof(record))
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecord():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btestbulk.py
rc = btrieveBulkRetrieveResult.GetRecord(1, record)
assert(rc == recordLength), "Error: BtrieveBulkRetrieveResult::GetRecord():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveBulkRetrieveResult.GetLastStatusCode()))
Return values
>= 0The number of bytes read. The number of bytes read is limited to Btrieve::MAXIMUM_RECORD_LENGTH. See BtrieveFile::RecordRetrieveChunk for retrieving records greater than Btrieve::MAXIMUM_RECORD_LENGTH in length.
-1An error has occurred. Use BtrieveBulkRetrieveResult::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples
bfilter.cpp, and btestbulk.cpp.

◆ GetRecordCount()

int BtrieveBulkRetrieveResult::GetRecordCount ( )

Get the record count.

Snippet
C++ btestbulk.cpp
// If GetRecordCount() fails.
if ((i = btrieveBulkRetrieveResult.GetRecordCount()) != 1)
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecordCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btestbulk.py
rc = btrieveBulkRetrieveResult.GetRecordCount()
assert(rc == 1), "Error: BtrieveBulkRetrieveResult::GetRecordCount():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveBulkRetrieveResult.GetLastStatusCode()))
Return values
>= 0The record count.
-1An error has occurred. Use BtrieveBulkRetrieveResult::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples
bfilter.cpp, and btestbulk.cpp.

◆ GetRecordCursorPosition()

long long BtrieveBulkRetrieveResult::GetRecordCursorPosition ( int recordNumber)

Get the record cursor position.

Note
The signature for this method changed in PSQL v13 R2.
Parameters
[in]recordNumberThe record number.
Snippet
C++ btestbulk.cpp
// If GetRecordCursorPosition() fails.
if ((cursorPosition = btrieveBulkRetrieveResult.GetRecordCursorPosition(1)) < 0)
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecordCursorPosition():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btestbulk.py
rc = btrieveBulkRetrieveResult.GetRecordCursorPosition(1)
assert(rc >= 0), "Error: BtrieveBulkRetrieveResult::GetRecordCursorPosition():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveBulkRetrieveResult.GetLastStatusCode()))
Return values
>= 0The record cursor position.
-1An error has occurred. Use BtrieveBulkRetrieveResult::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples
bfilter.cpp, and btestbulk.cpp.

◆ GetRecordLength()

int BtrieveBulkRetrieveResult::GetRecordLength ( int recordNumber)

Get the record length.

Parameters
[in]recordNumberThe record number.
Snippet
C++ btestbulk.cpp
// If GetRecordLength() fails.
if ((i = btrieveBulkRetrieveResult.GetRecordLength(1)) != sizeof(record))
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecordLength():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btestbulk.py
rc = btrieveBulkRetrieveResult.GetRecordLength(1)
assert(rc == recordLength), "Error: BtrieveBulkRetrieveResult::GetRecordLength():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveBulkRetrieveResult.GetLastStatusCode()))
Return values
>= 0The record length.
-1An error has occurred. Use BtrieveBulkRetrieveResult::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples
bfilter.cpp, and btestbulk.cpp.