How to insert Timestamp with nano seconds in Oracle table
Moderators: chulett, rschirm, roy
How to insert Timestamp with nano seconds in Oracle table
Hi
I have a input text file which have timestamp in this format (yyyymmddhhmiss+nano sec ) value is like this (200512161015222323).
My requirement is how t move this value to the oracle timestamp attribute.
Which function i should use in transformer
My output should be like - 16/12/2005 10.15.22.2323 in oracle table
Please suggest me how to solve this .
Thanks,
I have a input text file which have timestamp in this format (yyyymmddhhmiss+nano sec ) value is like this (200512161015222323).
My requirement is how t move this value to the oracle timestamp attribute.
Which function i should use in transformer
My output should be like - 16/12/2005 10.15.22.2323 in oracle table
Please suggest me how to solve this .
Thanks,
rv
Veni,
what have you tried to do so far that didn't work?
what have you tried to do so far that didn't work?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I would do it with either the ICONV & OCONV combination or substrings; both will work efficiently and accurately.
If your input data is always correct in the format yyyymmddhhmiss+nano sec and your output is in the form dd/mm/yyy hh.mm.ss.mmmm
then your derivation would start off with the date portion looking like:
If your input data is always correct in the format yyyymmddhhmiss+nano sec and your output is in the form dd/mm/yyy hh.mm.ss.mmmm
then your derivation would start off with the date portion looking like:
Code: Select all
In.Col[7,2]:'/':In.Col[5,2]:'/':In.Col[1,4]
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Was that a question or an assertion? I'm not quite sure what you mean.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 37
- Joined: Sun Aug 01, 2004 1:18 am
HI allArndW wrote:I would do it with either the ICONV & OCONV combination or substrings; both will work efficiently and accurately.
If your input data is always correct in the format yyyymmddhhmiss+nano sec and your output is in the form dd/mm/yyy hh.mm.ss.mmmm
then your derivation would start off with the date portion looking like:
Code: Select all
In.Col[7,2]:'/':In.Col[5,2]:'/':In.Col[1,4]
I believe, the question is not ment to convertion in DataStage. The intension would be,.. How to load in oracle table. What data type has to be decleared for this format(dd/mm/yyy hh.mm.ss.mmmm).... Correct me, if i am wrong.
Cnu
Assuming the target field is a TIMESTAMP and not a DATE, you'd need a couple of things. First a VarChar field to hold it inside the job and then User Defined SQL to issue the TO_TIMESTAMP() as that datatype is not yet officially supported.
That's an opinion, btw, never had to actually deal with them myself as of yet.
That's an opinion, btw, never had to actually deal with them myself as of yet.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Given that everything's in the correct sequence, the Fmt() function with a mask seems to me to be an easy solution. The first example loses the fractional seconds, the second example keeps six digits' worth of them.
Code: Select all
Fmt(Inlink.TheCol, "L####-##-## ##:##:##")
Fmt(Inlink.TheCol, "L####-##-## ##:##:##.######")
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.