The intoasc() function
The intoasc() function converts the field values of an interval variable to an ASCII string that conforms to the ANSI SQL standard.
Syntax
mint intoasc(invvalue, outbuf)
intrvl_t *invvalue;
char *outbuf;
- invvalue
- A pointer to the initialized interval variable to convert.
- outbuf
- A pointer to a buffer to contain the ANSI-standard INTERVAL string for the value in invvalue.
Usage
The intoasc() function converts the digits of the fields in the interval variable to their character equivalents and copies them to the outbuf character string with delimiters (hyphen, space, colon, or period) between them. You must initialize the interval variable in invvalue with the qualifier that you want the character string to have.
- Field
- Field size
- Leading field
- As specified by precision
- Fraction
- As specified by precision
- All other fields
- Two digits
DDDDD HH:MM:SS.FFFFF
If you do not initialize the qualifier of the interval variable, the intoasc() function returns an unpredictable value, but this value does not exceed 21 bytes.
Return values
- 0
- The conversion was successful.
- <0
- The conversion failed.