The mi_column_nullable() function

The mi_column_nullable() function indicates whether a specified column in a row descriptor can contain SQL NULL values.

Syntax

mi_integer mi_column_nullable(row_desc, column_id)
   MI_ROW_DESC *row_desc;
   mi_integer column_id;
row_desc
A pointer to the row descriptor of the row that contains the column.
column_id
The column identifier of the column, which specifies the position of the column in the specified row descriptor. Column numbering follows C array-indexing conventions: the first column in the row is at position zero.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

A row descriptor can describe the structure of a row in a table or the structure of a row type. From the row descriptor that row_desc references, the mi_column_nullable() function checks for a NOT NULL column-level constraint for either structure:
  • Whether the column at position column_id in the row can contain SQL NULL values
  • Whether the field at position column_id for the row type can contain SQL NULL values

When you declare a table, you can specify that a particular column is not able to hold NULL values with the NOT NULL column-level constraint. For more information about column-level constraints, see the description of CREATE TABLE in the HCL OneDB™ Guide to SQL: Syntax.

For more information about row descriptors, see the HCL OneDB DataBlade® API Programmer's Guide.

Return values

0
The specified column or field is defined to reject SQL NULL values; that is, it was defined with the NOT NULL constraint.
1
The specified column or field is defined to accept SQL NULL values; that is, it has not been defined with the NOT NULL constraint.
MI_ERROR
The function was not successful.