date format
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 76
- Joined: Wed Jan 25, 2006 6:42 pm
date format
Hi,
i have source sequential file Date (varchar),
Target oracle database Date(Timestamp).
in transformer i am using the oconv like this
oconv(iconv(DSLINK2.COLUMN NAME, "DYMD"), "D-YMD[4,2,2]")
please correct me from wrong.
Thanks for your help.
i have source sequential file Date (varchar),
Target oracle database Date(Timestamp).
in transformer i am using the oconv like this
oconv(iconv(DSLINK2.COLUMN NAME, "DYMD"), "D-YMD[4,2,2]")
please correct me from wrong.
Thanks for your help.
ETL
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
Re: date format
[quote="vardhan354"]
i have source sequential file Date (varchar),
quote]
What is the format in the sequential file for the date field , for e.g. is it MMDDYYYY or DDMMYYYY as your usage of ICONV will depend on what format you receiveing.
i have source sequential file Date (varchar),
quote]
What is the format in the sequential file for the date field , for e.g. is it MMDDYYYY or DDMMYYYY as your usage of ICONV will depend on what format you receiveing.
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
Re: date format
I think I messed up with the quoting thing...![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
Hi
As datatype is a timestamp you need to concatenate the date with time.
As datatype is a timestamp you need to concatenate the date with time.
Code: Select all
oconv(iconv(DSLINK2.COLUMN NAME, "DYMD"), "D-YMD[4,2,2]") : "00:00:00"
Target oracle database Date(Timestamp).
in transformer i am using the oconv like this
oconv(iconv(DSLINK2.COLUMN NAME, "DYMD"), "D-YMD[4,2,2]")
please correct me from wrong.
-
- Participant
- Posts: 76
- Joined: Wed Jan 25, 2006 6:42 pm
Hi,
I am not talking about the source datatype. I am talking about the target datatype.You mentioned it as Timestamp.Based on the input, your conversion is wrong.Check at Iconv funtion. Check this
I am not talking about the source datatype. I am talking about the target datatype.You mentioned it as Timestamp.Based on the input, your conversion is wrong.Check at Iconv funtion. Check this
Code: Select all
oconv(iconv(DSLINK2.COLUMN NAME, "D-DMY[2,2,4]"), "D-YMD[4,2,2]"):"00:00:00"
vardhan354 wrote:thanks for youre response meena, Deepak.
The source date format is dd-mm-yyyy,
there is no timestamp in source.
Basing on this information is this correct
oconv(iconv(DSLINK2.COLUMN NAME, "DYMD"), "D-YMD[4,2,2]")
Thanks,
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It doesn't matter. Iconv() is clever enough to work it out. All you must provide is the first "D" and the date component designators (for example "MDY").
This article may help to explain why this is so.
This article may help to explain why this is so.
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.
give the oracle varchar format
if your source date format is varchar dd-mm-yyyy,
just use substring function to convert it to yyyymmdd.
Orcale will work very well on this string.
just use substring function to convert it to yyyymmdd.
Orcale will work very well on this string.