Hi,
I am using CSV file as my input stage with date data type defined as varchar2(20) . The format is date with timestamp.My target data type is date. I also want to preserve its timestamp. My target database is oracle10g.
Can anybody help me out how do i make conversion from varchar to date in transformer.
Thanks in advance
Nilesh
Conversion from varchar data type to date with timestamp
Moderators: chulett, rschirm, roy
Conversion from varchar data type to date with timestamp
Nilesh Malekar
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
As there are no data types within DataStage (Server Edition), if your source date is in valid timestamp format, you can load it straight in to a column whose data type is TimeStamp. If your source data character string is not in valid format, then use substring and concatenation to get it into a valid format.
If this is a server job, I think above functions won't work.Maveric wrote:StringToTimestamp(). and then DateFromTimestamp().
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In what format is the date/time in the CSV file? If it is correct for your Oracle settings, then (as others have observed) you need to do nothing. Otherwise you can re-arrange the string components with substring and concatenation operators.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.