The mi_lo_decrefcount() function

The mi_lo_decrefcount() function decrements the reference count of a smart large object.

Syntax

mi_integer mi_lo_decrefcount(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_decrefcount() function is useful for manually tracking multiple references to the same smart large object. Typical use of this function is in the destroy() support function of an opaque data type that contains smart large objects. Use the mi_lo_decrefcount() function in the destroy() support function to decrement the reference count of the smart large object that is being deleted by one, as follows:
  • If the opaque type does not have an lohandles() support function, you must use the mi_lo_decrefcount() function in the destroy() support function of the opaque type.
  • If the opaque type has an lohandles() support function, do not use the mi_lo_decrefcount() function in the destroy() support function. The database server automatically decrements the reference count when it executes the lohandles() support function at destroy time.
Server only: The mi_lo_decrefcount() 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 Informix® 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.