The incvasc() function

The incvasc() function converts a string that conforms to the ANSI SQL standard for an INTERVAL value to an interval value.

Syntax

mint incvasc(inbuf, invvalue)
   char *inbuf;
   intrvl_t *invvalue;
inbuf
A pointer to the buffer that contains the ANSI-standard INTERVAL string to convert.
invvalue
A pointer to an initialized interval variable.

Usage

You must initialize the interval variable in invvalue with the qualifier that you want this variable to have.

The character string in inbuf can have leading and trailing spaces. However, from the first significant digit to the last, inbuf can only contain characters that are digits and delimiters that are appropriate to the qualifier fields of the interval variable.

If the character string is an empty string, the incvasc() function sets the value in invvalue to null. If the character string is acceptable, the function sets the value in the interval variable and returns zero. Otherwise, the function sets the value in the interval value to null.

Return values

0
The conversion was successful.
-1260
It is not possible to convert between the specified types.
-1261
Too many digits in the first field of datetime or interval.
-1262
Non-numeric character in datetime or interval.
-1263
A field in a datetime or interval value is out of range or incorrect.
-1264
Extra characters at the end of a datetime or interval value.
-1265
Overflow occurred on a datetime or interval operation.
-1266
A datetime or interval value is incompatible with the operation.
-1267
The result of a datetime computation is out of range.
-1268
A parameter contains an invalid datetime or interval qualifier.