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 > Need Syntax help for timestamp YYYY-MM-DD-HH.MM.SS.ssssss!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-17-04, 14:43
satish_nath satish_nath is offline
Registered User
 
Join Date: Dec 2003
Posts: 6
Need Syntax help for timestamp YYYY-MM-DD-HH.MM.SS.ssssss!!

Thanks in adavance for looking into my post.

I need some help to write help to write a syntax in sql for Db2 that would give me a timestamp

of the following format...

YYYY-MM-DD-HH.MM.SS.ssssss

I need the 100th part of the second as i am trying to measure query execution time.

Will apprecite all suggestions, i am working Windows OS and Db2 8.1.3.

Last edited by satish_nath; 04-17-04 at 14:47.
Reply With Quote
  #2 (permalink)  
Old 04-17-04, 15:41
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: Need Syntax help for timestamp YYYY-MM-DD-HH.MM.SS.ssssss!!

$ db2 "values(current timestamp,microsecond(current timestamp)) "

1 2
-------------------------- -----------
2004-04-17-21.04.21.746995 746995

1 record(s) selected.

HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 04-18-04, 00:51
famudba famudba is offline
Registered User
 
Join Date: Jan 2004
Location: Tallahassee, FL, USA
Posts: 96
to handled timestamp in db2

use following functions

TIMESTAMP

TIMESTAMP(START_DATE)

TIMESTAMP_FORMAT


use above functions


Let me know, if any questions.


lekharaju Ennam
Certified Oracle8i & DB2 UDB DBA
Reply With Quote
  #4 (permalink)  
Old 04-22-04, 03:00
satish_nath satish_nath is offline
Registered User
 
Join Date: Dec 2003
Posts: 6
Thanks for Help!!! Solved my Problem.

Quote:
Originally posted by famudba
to handled timestamp in db2

use following functions

TIMESTAMP

TIMESTAMP(START_DATE)

TIMESTAMP_FORMAT


use above functions


Let me know, if any questions.


lekharaju Ennam
Certified Oracle8i & DB2 UDB DBA
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