Validate an LO handle

An LO handle is valid when it correctly identifies the location of a smart large object in an sbspace.

An LO handle might be invalid for either of the following reasons:
  • The memory address is invalid or a NULL-valued pointer.
  • The LO handle contains invalid reference data.
Use the mi_lo_validate() function to check whether an LO handle is valid. If mi_lo_validate() returns a positive integer, the LO handle is invalid. You can mark this LO handle as invalid with the mi_lo_invalidate() function. The following code fragment checks whether the LO handle that LO_hdl references is valid:
if ( mi_lo_validate(conn, LO_hdl) > 0 )
   mi_lo_invalidate(conn, LO_hdl);

You can use the mi_lo_validate() function in the support function of an opaque data type that contains smart large objects. In the lohandles() support function, this function can determine unambiguously which LO handles are valid for the given instance of the opaque type.