【发布时间】:2015-11-09 22:45:21
【问题描述】:
我正在尝试将以下 Teradata SQL 转换为 Oracle。问题是我无法在 Oracle 中找到等效的时区值。在下面的示例中,Oracle 无法识别“Europe Central”。
select hi.create_date
, to_char( hi.create_date,'YYYY-MM-DD HH24:MI:SS')
, ((CAST(to_char( hi.create_date,'YYYY-MM-DD HH24:MI:SS')||'+00:00' AS TIMESTAMP(0))) at time zone 'Europe Central')
from historical_info hi
Oracle 中的以下代码会引发错误:
SELECT create_date,
CAST( create_date
AS TIMESTAMP WITH TIME ZONE
) AT TIME ZONE 'Europe Central'
TZ_LOSANG
FROM historical_info
ORA-01878: specified field not found in datetime or interval.
01878. 00000 - "specified field not found in datetime or interval"
*Cause: The specified field was not found in the datetime or interval.
*Action: Make sure that the specified field is in the datetime or interval.
您能否帮我将 Teradata 时区转换为 Oracle 识别的时区。
【问题讨论】:
-
您遇到什么错误?欧洲有没有一个城市可以作为该地区的示例?
-
收到以下错误。 ORA-01878: 在日期时间或间隔中找不到指定的字段。 01878. 00000 - “在日期时间或间隔中未找到指定字段” *原因:在日期时间或间隔中未找到指定字段。 *Action:确保指定的字段在日期时间或时间间隔内。
-
不,我没有任何特定的城市。由于我在 Teradata 中的当前数据没有按城市分类的时区,因此我无法对应 Oracle 中的等效时区,该时区具有欧洲/都柏林、欧洲/泽西等时区值。