Storage
A PERIOD(TIME[(n)]) is a fixed length data type and is saved as two TIME values.
Element Type | Field Size in bytes | Maximum Size in bytes in the row |
---|---|---|
TIME(n) | 12 | 16 |
External Representation of PERIOD(TIME)
In field mode, Analytics Database returns PERIOD(TIME) data as character data.
Assume L is the maximum length of the formatted character string for the format associated with this Period data type. The resulting character string contains two strings representing the beginning and ending bounds of the period value expression, each up to length L , and each enclosed in apostrophes ('), separated by comma and a space (,), and then enclosed within a left and right parenthesis [( )]. Thus, the maximum length of the resulting character string is 2* L +8.
For modes other than field mode, and for input data, the external representation of PERIOD(TIME) consists of two consecutive time values. Each time value consists of the following fields, returned in the specified order:
- Second: 4-byte, signed integer flipped to client form. This integer represents the number of seconds as a scaled decimal (for example, 12.56 seconds is returned as 12560000).
- Hour: 1 unsigned byte. This byte represents the number of hours.
- Minute: 1 unsigned byte. This byte represents the number of minutes.
Restrictions
A primary index column or partitioning column cannot be a column that has a Period data type.