Hi all,
I have a varchar column coming the source(ds) which needs to be converted to date (target oracle's default date format).
Format eg : 11 jun 2011 11 : 30
This needs to be converted to oracle's standard date format. I tried in transformer using stringtodate(inputcolumn,'%yyyy-%mm-%dd'). I gives minimum characters in the required year place something like that. I understand that the format is wrong. Please help in this conversion..
Thanks in advance.
data format conversion
Moderators: chulett, rschirm, roy
Will you be loading an Oracle table using DataStage? If so, tackle the task of converting the string into a Date datatype within DataStage first (well, do that anyway ). StringToDate() function in the parallel transformer would be an appropriate starting point.
If you're loading the table with a DataStage job and the date is stored as an Oracle Date datatype, DataStage will handle the conversion from DS Date (or Timestamp if you prefer) to Oracle Date automatically and you don't need to worry about formatting it for Oracle (dates and databases have been discussed many times here).
Regards,
If you're loading the table with a DataStage job and the date is stored as an Oracle Date datatype, DataStage will handle the conversion from DS Date (or Timestamp if you prefer) to Oracle Date automatically and you don't need to worry about formatting it for Oracle (dates and databases have been discussed many times here).
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
As mentioned, i tried with StringToDate(UStringToString(lnk_scAuditKey.timestamp),'%dd %mon %yyyy'). Input format is 30 jul 2011 11:30. I tried with StringToTimestamp also. in the format of '%dd %mmm %yyyy %hh : %mm : %ss'. But that also not working.
Error
: Data string '30 Jun 2011 ' does not match format '%dd %mon %yyyy': an integer was expected to match tag %m.
Error
: Data string '30 Jun 2011 ' does not match format '%dd %mon %yyyy': an integer was expected to match tag %m.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: