Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01882: timezone region not found error

Hi Team

Running this SQL in SQL promot and get error ORA-01882: timezone region not found

SELECT
f.code AS "DC",
c.code,
au.username,
TO_CHAR(cw.MOD_TS AT TIME ZONE tz.code, 'DD-MON-YYYY HH24:MI:SS') AS mod_ts
FROM
Table 1 cw
JOIN
Table2 au ON cw.au_uid = au.id
JOIN
Table3 f ON cw.fac_id = f.id
JOIN
Table4 c ON cw.comp_id = c.id
JOIN
time_zone tz ON f.TIME_ZONE_ID = tz.id
WHERE
au.username = 'INTGUSR001';

If i do the following it works..

TO_CHAR(cw.MOD_TS AT TIME ZONE ‘UTC’, 'DD-MON-YYYY HH24:MI:SS')

but i would like to pass the tz.code value to dynamically calculate it as each row in Table3 can have different value for the timezone.

Thanks

sudarsan.

Comments
Post Details
Added on Jan 17 2024
2 comments
596 views