The mi_lo_validate() function

The mi_lo_validate() function checks whether a given LO handle is valid.

Syntax

mi_integer mi_lo_validate(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 to validate.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_lo_validate() checks whether the LO handle that LO_hdl references is valid. An LO handle might be invalid for any of the following reasons:
  • The memory address is invalid or NULL.
  • The LO handle contains invalid reference data because:
    • It was never set to a valid value.
    • It was explicitly invalidated with the mi_lo_invalidate() function.

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.

If mi_lo_validate() fails because of an invalid connection, callbacks are invoked.

Server only: The mi_lo_validate() 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 LO handle that LO_hdl references is valid.
>0
The LO handle that LO_hdl references is invalid.
MI_ERROR
The connection was invalid.