If you specify an AT clause for a TIMESTAMP[(n)] without time zone target data type, an error is returned.
If you specify an AT clause for a TIMESTAMP[(n)] WITH TIME ZONE target data type, the following table shows the result of the CAST function or Teradata conversion based on the options specified. If the target precision is higher than the source precision, trailing zeros are added in the result to adjust the precision. If the target precision is lower than the source precision, an error is returned.
Option | timestamp_expression Data type | Result |
---|---|---|
AT LOCAL | With or without TIME ZONE | Result is formed from timestamp portion of source timestamp_expression (in UTC) with result time zone displacement based on current session time zone. Data type of timestamp_expression without time zone is same as not specifying AT clause. |
AT SOURCE (where SOURCE is keyword and not column reference) |
WITH TIME ZONE | Result is formed from timestamp portion of source timestamp_expression (in UTC) and time zone displacement associated with timestamp_expression. Same as not specifying AT clause. |
Without TIME ZONE | Error is returned. | |
AT SOURCE TIME ZONE | WITH TIME ZONE | Result is formed from timestamp portion of source timestamp_expression (in UTC) and time zone displacement associated with timestamp_expression. Same as not specifying AT clause. |
Without TIME ZONE | Error is returned. | |
AT [ TIME ZONE ] expression | With or without TIME ZONE | Result is formed from timestamp portion of source timestamp_expression (in UTC) and time zone displacement defined by expression. |
AT [ TIME ZONE ] time_zone_string | With or without TIME ZONE | Result is formed from timestamp portion of source timestamp_expression (in UTC) and time zone displacement based on time_zone_string. Time zone displacement is determined based on time_zone_string and TIMESTAMP value of timestamp_expression at UTC. |