intervalSerializationMode
Controls the JSON output format for INTERVAL
values during serialization.
Syntax
intervalSerializationMode = value
The value parameter is a STRING:
"FGL": Genero default format (default)"ISO8601": ISO 8601 duration format
The value names are the same as util.JSON.setIntervalSerializationMode uses. The serializer matches them
case insensitively, and json.Serializer.getOption returns them in the spelling
of this list. The digit 0 is also accepted for "FGL", and
1 for "ISO8601".
A value that is not in this list raises error -15824.
intervalSerializationMode is an optional option.
Usage
"FGL"), the serializer writes
INTERVAL values in the Genero native format. Set to "ISO8601" to
write in ISO 8601 duration format:- For year-month interval types, the output format is
[-]PnnnnnnnnnYnnM(for example,P36Y06M). - For day-second interval types, the output format is
[-]PnnnnnnnnnDTnnHnnMnn[.nnnnn]S(for example,P2DT10H30M00S).
Month, hour, minute, and second parts get a leading zero when only one digit is significant (for
example, P36Y06M, not P36Y6M).
For a description of the Genero native and ISO 8601 duration formats, go to BDL to JSON type conversion rules.
util.JSON. For equivalent behavior,
use util.JSON.setIntervalSerializationMode.Affects
Serialization (BDL to JSON)
Example
To write INTERVAL values in ISO 8601 duration format:
CALL json.Serializer.setOption("intervalSerializationMode", "ISO8601")
For a complete example, go to Serializing DATETIME and INTERVAL values in standard formats.