The mi_lo_colinfo_by_name() function

The mi_lo_colinfo_by_name() function sets the fields of an LO-specification structure to the column-level storage characteristics for a specified database column.

Syntax

mi_integer mi_lo_colinfo_by_name(conn, column_spec, LO_spec)
   MI_CONNECTION *conn;
   const char *column_spec;
   MI_LO_SPEC *LO_spec;
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)

column_spec
A pointer to a buffer that contains the name of the database column whose column-level storage characteristics you want to use.
LO_spec
A pointer to the LO-specification structure into which mi_lo_colinfo_by_name() puts the storage characteristics for the column_spec column.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_lo_colinfo_by_name() function sets the fields of the LO-specification structure that LO_spec references to the storage characteristics for the column_spec database column. If this specified column does not have column-level storage characteristics defined for it, the database server uses the storage characteristics that are inherited.

The column_spec buffer must specify the column name in the following format:
database@server_name:table.column
In the preceding format, the database and server_name arguments are optional. The following column specifications are all valid:
  • Full column specification:
    emp_data@main_server:employee.resume
  • Column specification that omits the server_name argument:
    emp_data:employee.resume

    The mi_lo_colinfo_by_name() function assumes that the employee table resides in the specified database that the current database server manages.

  • Column specification that omits the database and server_name arguments:
    employee.resume

    The mi_lo_colinfo_by_name() function assumes that the employee table resides in the database that is currently open and that the current database server manages.

If the column is in a database that is ANSI compliant, you can also include the owner name, as follows:
database@server_name:owner.table.column
Server only: The mi_lo_colinfo_by_name() 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

MI_OK
The function was successful; LO_spec points to the LO-specification structure with the storage characteristics of column_spec.
MI_ERROR
The function was not successful.