The mi_lo_stat_refcnt() function

The mi_lo_stat_refcnt() function returns from an LO-status structure the reference count of a smart large object.

Syntax

mi_integer mi_lo_stat_refcnt(LO_stat)
   MI_LO_STAT *LO_stat;
LO_stat
A pointer to an LO-status structure that mi_lo_stat() allocates and fills in with status information.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_lo_stat_refcnt() function is the LO-status accessor function that returns the reference count from a set of status information. The reference count for a smart large object indicates the number of persistently stored LO handles that currently exist for the smart large object. The database server assumes that it can safely remove the smart large object and reuse any resources that are allocated to it when the reference count is zero and any of the following conditions exists:
  • The transaction in which the reference count was decremented commits.
  • The connection terminates and the smart large object was created during this connection, but its reference count was never incremented.

    The database server increments a reference count when it stores the LO handle for a smart large object in a row.

Important: Before you call mi_lo_stat_refcnt(), you must initialize an LO-status structure with the mi_lo_stat() function.

The mi_lo_stat_refcnt() function obtains the reference count from the LO-status structure that LO_stat references.

For more information about the reference count of a smart large object or about how to use an LO-status structure, see the HCL OneDB™ DataBlade® API Programmer's Guide.

Return values

>=0
The reference count for the smart large object whose status information is in the LO-status structure that LO_stat references.
MI_ERROR
The function was not successful.