ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to create a Timestamp from PutDate and PutTime

Post new topic  Reply to topic
 How to create a Timestamp from PutDate and PutTime « View previous topic :: View next topic » 
Author Message
Tibor
PostPosted: Tue Sep 18, 2001 11:18 pm    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

There is two field in Root.MQMD: PutDate and PutTime and I think I will store these values into a database. But why put into two columns when databases supports Timestamp columns.

I had no success: I can't create a single Timestamp value in ESQL from types Date and Time.

Any ideas?
Back to top
View user's profile Send private message
Outdesign
PostPosted: Wed Sep 19, 2001 2:00 am    Post subject: Reply with quote

Apprentice

Joined: 16 Sep 2001
Posts: 38
Location: Hampshire, UK

/* ----------------------------------------------------------------- */
/* create database table */
/* ----------------------------------------------------------------- */

db2 => create table test (tst_timestamp timestamp)

db2 => commit


/* ----------------------------------------------------------------- */
/* database node ESQL */
/* ----------------------------------------------------------------- */

-- MQMD PutDate and PutTime format can be view via Trace node ${Root}
-- MQMD.PutDate format = DATE 'ccyy-mm-dd'
-- MQMD.PutTime format = GMTTIME 'hh:mm:ss.mmm'
-- MQSI ESQL TIMESTAMP format = TIMESTAMP 'ccyy-mm-dd hh:mm:ss'

declare db2Format timestamp;

set db2Format =
substring(cast(Root.MQMD.PutDate as char) from 7 for 10) || ' ' ||
substring(cast(Root.MQMD.PutTime as char) from 10 for ;

insert into Database.test (tst_timestamp) values (db2Format);


/* ----------------------------------------------------------------- */
/* verify output */
/* ----------------------------------------------------------------- */

db2 => select tst_timestamp from test

TST_TIMESTAMP
--------------------------
2001-09-19-09.31.29.000000

1 record(s) selected.

db2 =>


[ This Message was edited by: Outdesign on 2001-09-19 03:04 ]

[ This Message was edited by: Outdesign on 2001-09-19 03:08 ]
Back to top
View user's profile Send private message Visit poster's website
Tibor
PostPosted: Wed Sep 19, 2001 11:19 pm    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Thanks Outdesign,

It works fine.

I had tried a similar ESQL code, but I concatenated the casting date and time values without substring(). Just I thought there exists an evident solution - from date and time to timestamp...

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to create a Timestamp from PutDate and PutTime
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.