The mi_lo_increfcount() function

The mi_lo_increfcount() function increments the reference count of a smart large object.

Syntax

mi_integer mi_lo_increfcount(conn, LO_hdl)
   MI_CONNECTION *conn;
   MI_LO_HANDLE *LO_hdl;
conn
This value is one of the following connection values:

A pointer to a connection descriptor established by a previous call to mi_open(), mi_server_connect(), or mi_server_reconnect().

A NULL-valued pointer (database server only)

LO_hdl
A pointer to the LO handle.
Valid in client LIBMI application? Valid in user-defined routine?
No Yes

Usage

The mi_lo_increfcount() function is useful for manually tracking multiple references to the same smart large object. Typical use of this function is in the assign() support function of an opaque data type that contains smart large objects. Use the mi_lo_increfcount() function in the assign() support function to increment the reference count of the new smart large object by one, as follows:
  • If the opaque type does not have an lohandles() support function, you must use the mi_lo_increfcount() function in the assign() support function of the opaque type.
  • If the opaque type has an lohandles() support function, do not use the mi_lo_increfcount() function in the assign() support function; the database server automatically increments the reference count when it executes the lohandles() support function at assign time.
Server only: The mi_lo_increfcount() function does not need a connection descriptor to execute. If your UDR does not need a valid connection for other operations, you can specify a NULL-valued pointer for the conn parameter to establish a NULL connection. For information about the advantages of a NULL connection, see the HCL OneDB™ DataBlade® API Programmer's Guide.

Return values

>=0
The new reference count for the smart large object that LO_hdl references.
MI_ERROR
The function was not successful.