informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_string_to_interval()

The mi_string_to_interval() function converts a text (string) representation of an interval value to its binary (internal) INTERVAL representation.

Syntax

Usage

The mi_string_to_interval() function converts the interval string that intvl_string references to its the internal INTERVAL value. An internal INTERVAL value is the format that the database server uses to store a value in a INTERVAL column of the database.

The interval string that intvl_string references has the following fixed format:

However, this interval string can contain only a subset of this range. In this case, the type_range argument must specify the range of qualifiers that the interval string contains. This qualifier range begins with the keyword interval and is followed by the range of qualifiers for the interval in the intvl_string. For example, the following call to mi_string_to_interval() converts the interval of 6 days, 5 hours, and 45 minutes to its internal INTERVAL format:

If the type_range argument is a NULL-valued pointer, the mi_string_to_interval() function assumes a default qualifier range of:

The mi_string_to_interval() function does not accept the interval string in the date and time formats of the current processing locale.

Return Values

mi_interval * is a pointer to the internal INTERVAL representation that mi_string_to_interval() has created.
NULL indicates that the function was not successful.

Related Topics

See the descriptions of the following functions: mi_interval_to_string(), mi_string_to_date(), mi_string_to_decimal(), mi_string_to_datetime(), and mi_string_to_money().

For more information on how to convert interval strings to internal INTERVAL format, see Converting Date or Time Between Text and Binary.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved