INFORMIX
DataBlade API Programmer's Manual
Chapter 12: DataBlade API Function Descriptions
Home Contents Index Master Index New Book

mi_lo_open()

The mi_lo_open() function opens an existing smart large object for access.

Syntax

Usage

To access the data of a smart large object, a DataBlade routine must first open the smart large object. The mi_lo_open() function opens an existing smart large object. The mi_lo_open() function performs the following steps to open the existing smart large object that LO_hdl references:

    1. It opens the new smart large object that LO_hdl references in the open mode that the flags argument specifies.

    2. It sets the LO seek position of the smart large object to byte zero (0).

    3. It obtains a lock on the smart-large-object data based on the open mode in the flags argument.

    The lock that mi_lo_open() obtains is released when the current transaction terminates.

    4. It returns an LO file descriptor that identifies the smart large object.

    When the mi_lo_open() function is successful, it returns a valid LO file descriptor. You can then use this file descriptor to identify which smart large object to access in subsequent function calls such as mi_lo_read() and mi_lo_write(). However, this LO file descriptor is only valid within the current database session.

Each mi_lo_open() call is implicitly associated with the current session. When this session ends, the database server deallocates any smart large objects that are not referenced by any columns (those with a reference count of zero).

Tip: The mi_lo_open() function replaces the mi_large_object_open() function, which Informix supports for backward compatibility only. Use mi_lo_open() for all new DataBlade routines.

Return Values

An MI_LO_FD

The LO file descriptor for the open smart large object that LO_hdl references.

MI_ERROR

The function was not successful.

Related Topics

See the descriptions of the following functions: mi_lo_close, mi_lo_copy(), mi_lo_create(), mi_lo_expand(), mi_lo_read(), mi_lo_readwithseek(), mi_lo_tell(), mi_lo_write(), and mi_lo_writewithseek().

In Chapter 3, "Handling Smart Large Objects," see "Opening a Smart Large Object" and "Smart-Large-Object Locks".




DataBlade API Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.