I have a couple of columns that, unfortunately, were incorrectly defined as TIMESTAMP(6)instead TIMESTAMP(6) WITH TIME ZONE. I would like to transfer these columns from the old, incorrect data type to the new, correct one. Also, the values were apparently fixed in E (S | D) T, and I need the value in UTC.
So far I have had the best:
alter table OOPSIE_TABLE add (
NEW_COLUMN_A timestamp(6) with time zone,
NEW_COLUMN_B timestamp(6) with time zone
);
update OOPSIE_TABLE set
NEW_COLUMN_A = COLUMN_A,
NEW_COLUMN_B = COLUMN_B
;
alter table OOPSIE_TABLE drop column (
COLUMN_A,
COLUMN_B
);
alter table OOPSIE_TABLE rename column NEW_COLUMN_A to COLUMN_A;
alter table OOPSIE_TABLE rename column NEW_COLUMN_B to COLUMN_B;
Unfortunately, this leaves me with data that looks like 15-JUN-12 05.46.29.600102000 PM -04:00when I want 15-JUN-12 09.46.29.600102000 PM UTC(or, be that as it may, Oracle formatted it).
select dbtimezone from dual;, +00:00, , . DML DST (, , America/New_York).