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 » CURRENT_GMTTIMESTAMP

Post new topic  Reply to topic
 CURRENT_GMTTIMESTAMP « View previous topic :: View next topic » 
Author Message
hayderr
PostPosted: Tue Aug 07, 2007 5:55 pm    Post subject: CURRENT_GMTTIMESTAMP Reply with quote

Novice

Joined: 14 May 2007
Posts: 22

Hello all,
I am using ESQL (Broker 6) to update a record in one of my DB2 tables. The code I am using below:

UPDATE TABLENAME M TIMESTMP = CURRENT_GMTTIMESTAMP WHERE M.STATUS = 'N';

The updated statement is done correctly but with LOCAL time instead of GMT time. My insert statement works correctly with GMT time. Only when I do any update to any record the time will be converted to local.

I am really stuck in this, any comment or help is much appreciated.

Thank you
Back to top
View user's profile Send private message
hayderr
PostPosted: Tue Aug 07, 2007 5:56 pm    Post subject: Reply with quote

Novice

Joined: 14 May 2007
Posts: 22

Corrected ESQL:

UPDATE TABLENAME AS M SET TIMESTMP = CURRENT_GMTTIMESTAMP
WHERE M.STATUS = 'N';

Regards
Back to top
View user's profile Send private message
AkankshA
PostPosted: Tue Aug 07, 2007 7:46 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

UPDATE Database.<DatabaseschemaName>.<tableName> AS M SET TIMESTMP = CURRENT_GMTTIMESTAMP WHERE M.STATUS = 'N';
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
hayderr
PostPosted: Tue Aug 07, 2007 7:54 pm    Post subject: Reply with quote

Novice

Joined: 14 May 2007
Posts: 22

Yes, this is what I am doing:
UPDATE Database.{dbSchema}.TABLENAME AS M SET STATUS = 'C',
TIMESTMP = CURRENT_GMTTIMESTAMP
WHERE M.STATUS = 'N';
Back to top
View user's profile Send private message
AkankshA
PostPosted: Tue Aug 07, 2007 8:00 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

hmmm.... that seems vague behaviour


how about storing the current_gmttimestamp in a variable and using debugger to see the cause

else just addup LOCAL_TIMEZONE in current_timestamp .. this shall give u gmttimestamp
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
hayderr
PostPosted: Tue Aug 07, 2007 8:24 pm    Post subject: Reply with quote

Novice

Joined: 14 May 2007
Posts: 22

I tried using a variable to pass the value. I used the debugger, the value I am passing to the Update statement is the correct one. When i check the table, the time is LOCAL.

DECLARE myTime GMTTIMESTAMP CURRENT_GMTTIMESTAMP;

UPDATE Database.{dbSchema}.TABLENAME AS M
SET TIMESTMP = myTime
WHERE M.STATUS = status;
Back to top
View user's profile Send private message
AkankshA
PostPosted: Tue Aug 07, 2007 8:29 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

seems like the problem wd ur db table

pls paste the table definition here.... do u have any constraints set on timestmp column???
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
hayderr
PostPosted: Tue Aug 07, 2007 9:09 pm    Post subject: Reply with quote

Novice

Joined: 14 May 2007
Posts: 22

CREATE TABLE SCHEMA.TABLENAME (
a CHAR( NOT NULL,
b CHAR(6) NOT NULL,
c INTEGER NOT NULL,
d CHAR(,
e CHAR(6),
f CHAR(2),
g CHAR(1),
h CHAR(,
i CHAR(6),
j CHAR(12),
k CHAR(1)
CONSTRAINT xyz
CHECK (UPPER(k) IN('A',
'N','S')),
TIMESTMP TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP
);
The problem is only with the UPDATE statement.

Thnak you in advance
Back to top
View user's profile Send private message
AkankshA
PostPosted: Tue Aug 07, 2007 9:22 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

TIMESTMP column is populated with local timestamp which is default value as specified in the table...

that shows that ur DB is not getting any value in TIMESTMP column.... i.e. null is being transferred there

weird

hmm... can't really provide u any accurate reasoning for this.. things wud be guess only... i would say check up the flow using debug once again as working wd insert and not with update seems strange

however a trial can be done using passthru
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
hayderr
PostPosted: Wed Aug 08, 2007 3:51 pm    Post subject: Reply with quote

Novice

Joined: 14 May 2007
Posts: 22

Thank you,
I will try PASSTHRU statement and see the results

Thanks again
Back to top
View user's profile Send private message
hayderr
PostPosted: Mon Aug 13, 2007 8:14 pm    Post subject: Reply with quote

Novice

Joined: 14 May 2007
Posts: 22

Hello all,
I tried the PASSTHRU and the it is the same, with the UPDATE the time is LOCAL.
Is it worth opening a PMR for it?

Thanks
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 » CURRENT_GMTTIMESTAMP
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.