Timestamp and DB2
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
Timestamp and DB2
I am writing the timestamp (YYYY-DD-MM HH:MI:SS.SSSSSS) into a DB2 tables, from a job.
The data when written to a seq file, is written with the microseconds., but when the same is written into a DB2 table, the microseconds change to '000000'.
How do I handle the issue.???
The data when written to a seq file, is written with the microseconds., but when the same is written into a DB2 table, the microseconds change to '000000'.
How do I handle the issue.???
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
What if you insert something thats on the higher end in the nanoseconds category. Something like
'2006-10-23 17:15:58.835789'
Does that get rounded off too
'2006-10-23 17:15:59.000000'
What if you specify the sql type as varchar, do you still encounter the same problem?
'2006-10-23 17:15:58.835789'
Does that get rounded off too
'2006-10-23 17:15:59.000000'
What if you specify the sql type as varchar, do you still encounter the same problem?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
Are you providing any sort of transformations?
I have worked with DB2. If you dont insert the nano seconds part, only then the database will add .000000 to it. If you are passing it, then it gets inserted as it is. If nothing else worked, varchar should have worked. There is something else going on. Are you doing any iconv/oconv of type MTS?
Did you try inserting a record with nano seconds from command line? does that work?
I have worked with DB2. If you dont insert the nano seconds part, only then the database will add .000000 to it. If you are passing it, then it gets inserted as it is. If nothing else worked, varchar should have worked. There is something else going on. Are you doing any iconv/oconv of type MTS?
Did you try inserting a record with nano seconds from command line? does that work?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
The datatype is TImestamp.
I have verified, populating, a Seq File, that the nano seconds are coming properly....
Also, am not using any othe Trans (Iconv or Oconv)...
I ahve also tried inserting from Command Line...it is going abs fine...
but the prob is coming from Ascential to DB2.....
Even tried by hard coding a vakue like. 2006-12-12 12:15:16.123456..
nut it is going like 2006-12-12 12:15:16.000000!
I have verified, populating, a Seq File, that the nano seconds are coming properly....
Also, am not using any othe Trans (Iconv or Oconv)...
I ahve also tried inserting from Command Line...it is going abs fine...
but the prob is coming from Ascential to DB2.....
Even tried by hard coding a vakue like. 2006-12-12 12:15:16.123456..
nut it is going like 2006-12-12 12:15:16.000000!