Collaboration diagram for Cursor Information Functions:

Functions

RDM_RETCODE rdm_cursorGetCount (RDM_CURSOR cursor, uint64_t *count)
Get the row count for a cursor. More...
RDM_RETCODE rdm_cursorGetDatabase (RDM_CURSOR cursor, RDM_DB *pDb)
Get the RDM_DB handle associated with a cursor. More...
RDM_RETCODE rdm_cursorGetMemberCount (RDM_CURSOR cursor, RDM_REF_ID refId, uint64_t *memberCount)
Get the member count for a set owner row. More...
RDM_RETCODE rdm_cursorGetOwnerRowId (RDM_CURSOR cursor, RDM_REF_ID refId, RDM_ROWID_T *rowid)
Get the rowid of a set owner. More...
RDM_RETCODE rdm_cursorGetOwnerTableId (RDM_CURSOR cursor, RDM_REF_ID refId, RDM_TABLE_ID *tableId)
Get the table id for the refId owner for the current row of a cursor. More...
RDM_RETCODE rdm_cursorGetRowId (RDM_CURSOR cursor, RDM_ROWID_T *rowid)
Get the rowid for the current row of the cursor. More...
RDM_RETCODE rdm_cursorGetRowStatus (RDM_CURSOR cursor, RDM_ROW_STATUS_INFO *rowStat)
Get the row status information for a status cursor. More...
RDM_RETCODE rdm_cursorGetTableId (RDM_CURSOR cursor, RDM_TABLE_ID *tableId)
Get the table id for the current row of the cursor. More...
RDM_RETCODE rdm_cursorGetType (RDM_CURSOR cursor, RDM_CURSOR_TYPE *type)
Get the cursor type. More...
RDM_RETCODE rdm_cursorHasMembers (RDM_CURSOR cursor, RDM_REF_ID refId, RDM_BOOL_T *hasMembers)
Check to see if a row has members for the specified set. More...
RDM_RETCODE rdm_cursorHasOwner (RDM_CURSOR cursor, RDM_REF_ID refId, RDM_BOOL_T *hasOwner)
Check to see if a row is a member for the specified set. More...

Detailed Description

API for retrieving information for core cursors.  All the
fuctions here are located in \ref lib_rdm. Linker option:\
 <pre><code>    -l<tt><a href="lib_rdm.html">rdmrdm</a></tt></code></pre>  See \ref cursor
for a more detailed description of a cursor.

Function Documentation

rdm_cursorGetCount()

RDM_RETCODE rdm_cursorGetCount ( RDM_CURSOR cursor,
uint64_t * count
)

#include <rdmcursorapi.h>

Get the row count for a cursor.

This function returns the row count for the specified cursor.

A singleton cursor has by definition only one row.

Locking Requirements
Read lock on the table associated with the cursor
Return values
sOKAY Normal, successful return.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
See also
rdm_dbStartRead
rdm_dbStartSnapshot
rdm_dbStartUpdate
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSelf
Parameters
[in] cursor [in] The cursor to get the record count of
[out] count [out] A pointer to the returned record count

rdm_cursorGetDatabase()

RDM_RETCODE rdm_cursorGetDatabase ( RDM_CURSOR cursor,
RDM_DB * pDb
)

#include <rdmcursorapi.h>

Get the RDM_DB handle associated with a cursor.

This function assigns the RDM_DB handle associated with an RDM_CURSOR to the pDb.

Locking Requirements
None
Return values
sOKAY Normal, successful return.
See also
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSelf
Parameters
[in] cursor [in] The cursor to get the database handle for
[out] pDb [out] A pointer to an RDM_DB that will be assigned the db handle associated with cursor

rdm_cursorGetMemberCount()

RDM_RETCODE rdm_cursorGetMemberCount ( RDM_CURSOR cursor,
RDM_REF_ID refId,
uint64_t * memberCount
)

#include <rdmcursorapi.h>

Get the member count for a set owner row.

This function calculates the member count of the set identified by refId for the owner identified by the current row of cursor.

The current row of cursor must be a valid owner of refId.

Locking Requirements
Read lock on the member table and the owner table (cursor) associated with the set refId
Return values
sOKAY Normal, successful return.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
See also
rdm_dbStartRead
rdm_dbStartSnapshot
rdm_dbStartUpdate
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSiblingRows
rdm_cursorGetSelf
rdm_cursorMoveToNext
Parameters
[in] cursor [in] The cursor whose current row we will get the member count of
[in] refId [in] The set identifier for the requesting count
[out] memberCount [out] A pointer to the returned set member count

rdm_cursorGetOwnerRowId()

RDM_RETCODE rdm_cursorGetOwnerRowId ( RDM_CURSOR cursor,
RDM_REF_ID refId,
RDM_ROWID_T * rowid
)

#include <rdmcursorapi.h>

Get the rowid of a set owner.

This function retrieves the rowid of the owning row of the refId set for the current record of cursor.

If the current row of cursor is not at a valid member of the set an error will be returned.

Locking Requirements
Read lock on the member table and the owner table associated with the set refId
Return values
sOKAY Normal, successful return.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
See also
rdm_dbStartRead
rdm_dbStartSnapshot
rdm_dbStartUpdate
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSelf
rdm_cursorGetSiblingRows
rdm_cursorMoveToNext
rdm_cursorGetOwnerRow
rdm_cursorGetOwnerTableId
Parameters
[in] cursor [in] The cursor to get the owner rowid from
[in] refId [in] The set identifier of the set to get the owner rowid of
[out] rowid [out] A pointer to the returned rowid

rdm_cursorGetOwnerTableId()

RDM_RETCODE rdm_cursorGetOwnerTableId ( RDM_CURSOR cursor,
RDM_REF_ID refId,
RDM_TABLE_ID * tableId
)

#include <rdmcursorapi.h>

Get the table id for the refId owner for the current row of a cursor.

This function returns the table identifier of the refId owner for the row that is in the current position of cursor

If the current row of cursor is not at a valid member of the set an error will be returned.

Locking Requirements
Read lock on member table (cursor) and owner table associated with refId.
Return values
sOKAY Normal, successful return.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
See also
rdm_dbStartRead
rdm_dbStartSnapshot
rdm_dbStartUpdate
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSelf
rdm_cursorGetSiblingRows
rdm_cursorMoveToNext
rdm_cursorGetOwnerRow
rdm_cursorGetOwnerRowId
rdm_cursorGetTableId
Parameters
[in] cursor [in] The cursor to get the table id for
[in] refId [in] The set identifier
[out] tableId [out] A pointer to the returned table id

rdm_cursorGetRowId()

RDM_RETCODE rdm_cursorGetRowId ( RDM_CURSOR cursor,
RDM_ROWID_T * rowid
)

#include <rdmcursorapi.h>

Get the rowid for the current row of the cursor.

This function retrieves the rowid for the current row of cursor. If the cursor is not at a valid row an error will be returned.

Locking Requirements
Read lock on the table associated with the cursor
Return values
sOKAY Normal, successful return.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
See also
rdm_dbStartRead
rdm_dbStartSnapshot
rdm_dbStartUpdate
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSelf
rdm_cursorGetSiblingRows
rdm_cursorMoveToNext
rdm_cursorGetOwnerRowId
Parameters
[in] cursor [in] The cursor to get the rowid from
[out] rowid [out] A pointer to the returned rowid value

rdm_cursorGetRowStatus()

RDM_RETCODE rdm_cursorGetRowStatus ( RDM_CURSOR cursor,
RDM_ROW_STATUS_INFO * rowStat
)

#include <rdmcursorapi.h>

Get the row status information for a status cursor.

This function retrieves the current row status information for a status cursor. A status cursor can be return from a bulk insert operation.

See also
rdm_dbInsertRows
Locking Requirements
None
Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
eNOCURRENTROW The cursor is not positioned to a valid row.
See also
rdm_dbStartRead
rdm_dbStartSnapshot
rdm_dbStartUpdate
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSelf
rdm_cursorGetSiblingRows
rdm_cursorMoveToNext
rdm_cursorGetStatus
Parameters
[in] cursor [in] The cursor to get the rowid from
[out] rowStat [out] A pointer to the row status value

rdm_cursorGetTableId()

RDM_RETCODE rdm_cursorGetTableId ( RDM_CURSOR cursor,
RDM_TABLE_ID * tableId
)

#include <rdmcursorapi.h>

Get the table id for the current row of the cursor.

This function returns the table identifier of the row that is in the current position of cursor

Locking Requirements
None
Return values
sOKAY Normal, successful return.
eDBNOTOPEN Database not open.
See also
rdm_dbStartRead
rdm_dbStartSnapshot
rdm_dbStartUpdate
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSelf
rdm_cursorGetSiblingRows
rdm_cursorMoveToNext
rdm_cursorGetOwnerTableId
Parameters
[in] cursor [in] The cursor to get the table id for
[out] tableId [out] A pointer to the returned table id

rdm_cursorGetType()

RDM_RETCODE rdm_cursorGetType ( RDM_CURSOR cursor,
RDM_CURSOR_TYPE * type
)

#include <rdmcursorapi.h>

Get the cursor type.

This function will return the type of cursor

Locking Requirements
None
Return values
sOKAY Normal, successful return.
See also
rdm_dbGetRows
rdm_dbGetRowsByKey
rdm_cursorGetMemberRows
rdm_cursorGetSelf
Parameters
[in] cursor [in] The cursor to be freed
[out] type [out] The type of the cursor

rdm_cursorHasMembers()

RDM_RETCODE rdm_cursorHasMembers ( RDM_CURSOR cursor,
RDM_REF_ID refId,
RDM_BOOL_T * hasMembers
)

#include <rdmcursorapi.h>

Check to see if a row has members for the specified set.

This function checks to see if current row of cursor is a referenced through the set identified by refId.

The cursor does not need to be a set cursor but its current row must be in a table that is a valid owner of the set identified by refId.

The hasMembers parameter is set to RDM_TRUE if the row has members, otherwise RDM_FALSE.

Locking Requirements
Read lock on the owner and member tables associated with the set refId
Return values
sOKAY Normal, successful return.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
See also
rdm_dbStartRead
rdm_dbStartSnapshot
rdm_dbStartUpdate
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSelf
rdm_cursorGetSiblingRows
rdm_cursorMoveToNext
Parameters
[in] cursor [in] The cursor to check set ownership status
[in] refId [in] The set identifier for the request
[in] hasMembers [in] A pointer to the referenced status

rdm_cursorHasOwner()

RDM_RETCODE rdm_cursorHasOwner ( RDM_CURSOR cursor,
RDM_REF_ID refId,
RDM_BOOL_T * hasOwner
)

#include <rdmcursorapi.h>

Check to see if a row is a member for the specified set.

This function checks to see if current row of cursor is an active set member (is linked to an owner) for the set identified by refId.

The cursor does not need to be a set cursor but its current row must be in a table that is a valid member of the set identified by refId.

The hasOwner parameter is set to RDM_TRUE if the record has an active owner, otherwise RDM_FALSE.

Locking Requirements
Read lock on the member table associated with the set refId
Return values
sOKAY Normal, successful return.
eNOSTARTREAD A read operation was attempted when no rdm_dbStartSnapshot(), rdm_dbStartRead(), or rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDBNOTOPEN Database not open.
eNOCURRENTROW The cursor is not positioned to a valid row.
eOWNERDELETED The owner row for a set cursor has been deleted.
eSINGLETONDELETED The row for a singleton cursor has been deleted.
See also
rdm_dbStartRead
rdm_dbStartSnapshot
rdm_dbStartUpdate
rdm_dbGetRows
rdm_cursorGetMemberRows
rdm_cursorGetSelf
rdm_cursorGetSiblingRows
rdm_cursorMoveToNext
Parameters
[in] cursor [in] The cursor to check set ownership status
[in] refId [in] The set identifier for the request
[in] hasOwner [in] A pointer to the returned status