INFORMIX
Informix-ESQL/C Programmer's Manual
Chapter 7: Working with INFORMIX-Universal Server Smart Large
Home Contents Index Master Index New Book

Obtaining Status of a Smart Large Object

To obtain status information for a smart large object, take the following steps:

1. Obtain a valid LO-pointer structure to the smart large object for which you want status.

    2. Allocate and fill an LO-status structure with the ifx_lo_stat() function

    3. Use the appropriate ESQL/C accessor function to obtain the status information you need.

    4. Deallocate the LO-status structure.

Obtaining a Valid LO-Pointer Structure

You can obtain status information for any smart large object for which you have a valid LO-pointer structure. You can perform either of the following steps to obtain an LO-pointer structure:

Allocating and Accessing an LO-Status Structure

The LO-status structure stores status information for a smart large object. This section describes how to allocate and access an LO-status structure.

Allocating an LO-Status Structure

The ifx_lo_stat() function performs the following tasks:

For more information on the ifx_lo_stat() function, see page 7-81.

Accessing the LO-Status Structure

The LO-status structure, ifx_lo_stat_t, stores the status information for a smart large object in an ESQL/C program. The locator.h header file defines the LO-status structure so you must include the locator.h file in your ESQL/C programs that access this structure.

Important: The LO-status structure, ifx_lo_stat_t, is an opaque structure to ESQL/C programs. Do not access its internal structure directly. Informix does not guarantee that the internal structure of ifx_lo_stat_t will not change in future releases. Therefore, to create portable code, always use the ESQL/C accessor functions for this structure (which Figure 7-7 shows) to obtain and store values in the LO-status structure.
Figure 7-7 shows the status information along with the corresponding ESQL/C accessor functions.

Figure 7-7
Status Information in the LO-Status Structure

Disk-Storage Information Description ESQL/C Accessor Functions

Last access time

The time, in seconds, that the smart large object was last accessed.

This value is available only if the LO_KEEP_LASTACCESS_TIME flag is set for this smart large object.

ifx_lo_stat_atime()

Storage characteristics

The storage characteristics for the smart large object.

These characteristics are stored in an LO-specification structure (see page 7-7). Use the ESQL/C accessor functions for an LO-specification structure (see Figure 7-1 and Figure 7-2) to obtain this information.

ifx_lo_stat_cspec()

Last change in status

The time, in seconds, of the last status change for the smart large object.

A change in status includes updates, changes in ownership, and changes to the number of references.

ifx_lo_stat_ctime()

Last modification
time (seconds)

The time, in seconds, that the smart large object was last modified.

ifx_lo_stat_mtime_sec()

Reference count

A count of the number of references to the smart large object.

ifx_lo_stat_refcnt()

Size

The size, in bytes, of the smart large object.

ifx_lo_stat_size()

The time values (such as last access time and last change time) might differ slightly from the system time. This difference is due to the algorithm that the database server uses to obtain the time from the operating system.

Deallocating the LO-Status Structure

Once you have finished with an LO-status structure, deallocate the resources assigned to it with the ifx_lo_stat_free() function. When the resources are freed, they can be reallocated to other structures that your program needs. For more information on the ifx_lo_stat_free() function, see page 7-87.




Informix-ESQL/C Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.