The following rules and restrictions apply to specifying a simple expression as a time zone value.
- The simple expression you specify must be a constant; otherwise, the system aborts the request and returns an error to the requestor.
- The current session time zone can be either a time zone displacement or time zone string.
Current Session Time Zone Time Zone Displacement Time zone displacement Current session time zone. Time zone string Based on specified time zone string and UTC TIMESTAMP value for the source expression. See Daylight Saving Time and Time Zone Strings Specified as Time Zone Strings for valid time zone strings.
- Vantage implicitly converts the simple expression you specify as needed and if allowed, to a time zone displacement or time zone string depending on its data type as defined in the following table.
Expression Data Type Implicit Conversion - BIGINT
- BYTEINT
- INTEGER
- SMALLINT
CAST(CAST (expression AS INTERVAL HOUR(2)) AS INTERVAL HOUR(2) TO MINUTE - DECIMAL
- NUMERIC
where scale = 0
CAST(CAST (expression AS INTERVAL HOUR(2)) AS INTERVAL HOUR(2) TO MINUTE - DECIMAL
- NUMERIC
where scale > 0
CAST(CAST((expression)*60 AS INTERVAL MINUTE(4)) AS INTERVAL HOUR(2) TO MINUTE) INTERVAL HOUR(2) TO MINUTE no conversion INTERVAL HOUR(n) TO MINUTE, where n ¼ 2 CAST(expression) AS INTERVAL HOUR(2) TO MINUTE) - INTERVAL HOUR
- INTERVAL '0' DAY
- INTERVAL '-0' DAY
- INTERVAL DAY TO HOUR
- INTERVAL DAY TO MINUTE
- INTERVAL DAY TO SECOND
- INTERVAL HOUR
- INTERVAL HOUR TO SECOND
- INTERVAL MINUTE
- INTERVAL MINUTE TO SECOND
- INTERVAL SECOND
CAST(expression) AS INTERVAL HOUR(2) TO MINUTE) CHARACTER with CHARACTER SET UNICODE Attempt to CAST(CAST(AS INTERVAL HOUR(2)) AS INTERVAL HOUR(2) TO MINUTE). If an error occurs for the casts, attempt to CAST(expression AS INTERVAL HOUR(2) TO MINUTE).
If still unable to cast expression, Vantage treats the character value as a time zone string.
CHARACTER with CHARACTER SET ¼ UNICODE TRANSLATE (expression USING source_repertoire_name_TO_Unicode) where source_repertoire_name is server character set of expression.
If preceding translation causes error, implicit conversion is as in preceding row, with CHARACTER SET UNICODE replacing expression with the translation of expression.
Other System ends request and returns error to requestor. - Specifying a simple expression without first specifying TIME ZONE is valid syntax and has the same effect as specifying TIME ZONE simple_expression.