If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Timestamp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-20-07, 12:26
darkyhorse darkyhorse is offline
Registered User
 
Join Date: Dec 2007
Posts: 2
Timestamp

Hello,

I am newbie.

I have create some tables and columns. One thing bug me is timestamp data type.

I use IBM DB2 Express-C.

I looked up the table with control centre to see what length the TIMESTAMP is. The length is 10.

Isnt TIMESTAMP format '2007-12-10.12.12.32.3234'?

I got my insert data rejected because of that.

What did i do wrong?

Thanks

M
Reply With Quote
  #2 (permalink)  
Old 12-21-07, 03:20
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Welcome to the forum


Moved to DB2 topic
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 12-21-07, 04:16
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,
you have syntax error.

You can write:
2007-12-10-12.12.32.3234
or
2007-12-10-12.12.32.323400
but not like you wrote:
2007-12-10.12.12.32.3234

Hope this helps,
Grofaty
Reply With Quote
  #4 (permalink)  
Old 12-21-07, 05:01
nidm nidm is offline
Registered User
 
Join Date: May 2003
Posts: 113
" The length is 10." is for the internal binary format of timestamp. In another word, DB2 use 10 bytes to store a timestamp value. When display the value, the application and db2 usually show the string format which looks like '2007-....'. the string format takes 20 or so bytes(probably 26).

Quote:
Originally Posted by darkyhorse
Hello,

I am newbie.

I have create some tables and columns. One thing bug me is timestamp data type.

I use IBM DB2 Express-C.

I looked up the table with control centre to see what length the TIMESTAMP is. The length is 10.

Isnt TIMESTAMP format '2007-12-10.12.12.32.3234'?

I got my insert data rejected because of that.

What did i do wrong?

Thanks

M
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On