Re: Convert text to date.
Yes. Import it as a varchar, then set up a mysql function to parse the input and convert it to a date. Then convert the data. Then drop and rename columns.
drop function if exists myconvdate;
delimiter //
create function myconvdate (indate varchar(10)) returns date deterministic
begin
declare ccyymmdd date;
your code to parse indate and assign to ccyymmdd;
return ccyymmdd;
end;
//
delimiter ;
Then convert your data:
alter table xyz add column newdate date;
update xyz set newdate=myconvdate(olddate);
alter table xyz drop column olddate;
alter table xyz rename column newdate olddate;
Subject
Views
Written By
Posted
16176
July 27, 2007 02:42PM
Re: Convert text to date.
7585
August 17, 2007 10:54AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.