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 » MsgID Comparision with CorrID

Post new topic  Reply to topic
 MsgID Comparision with CorrID « View previous topic :: View next topic » 
Author Message
mbsa
PostPosted: Thu Dec 12, 2013 8:40 am    Post subject: MsgID Comparision with CorrID Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

Hello All,
I have a requirement where I need to store the MsgID, UUID (unique id), and Message in database and retrieved the message based on this correlation id.
I have the message id as 414d512050444c4e5831314d3030303252a44dca200f667f.
The DB, the column for storing the MsgID is char.
When I try to retrieve it from DB using ESQL is it coming as X’414d512050444c4e5831314d3030303252a44dca200f667f’
If I cast it as CAST (MSGID AS CHAR CCSID 437 ENCODING 546) IT COMES AS
AMQ PDLNX11M0002RñM╩ f and it is being stored in db.
But when I am trying to compare the MsgID with CorrID and trying to get the UUID for that message and log it to different table it is failing saying duplicate UUID. That compare between MsgID with CorrID is not happening.
My question is how I compare the MsgID and CorrID using ESQL.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Dec 12, 2013 9:25 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

The Datatype of the MQMD & CORRELID (and GROUPID for that matter) is BLOB.

You really need to change the datatype of the column you are storing this data in.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mbsa
PostPosted: Thu Dec 12, 2013 9:30 am    Post subject: Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

Thanks for the reply.If i change it to blob how do i compare MSgID and CorrID as blobs?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Dec 12, 2013 10:18 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

The same way you compare any other two values of the same dayatype.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Dec 12, 2013 10:18 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mbsa wrote:
Thanks for the reply.If i change it to blob how do i compare MSgID and CorrID as blobs?


The same way you compare them as char.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mbsa
PostPosted: Thu Dec 12, 2013 10:37 am    Post subject: Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

I changed the column datatype to varbinary(MAX).Then when i compare MsgID = CorrID.It says the = is not valid for comparing blob.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Dec 12, 2013 10:53 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mbsa wrote:
It says the = is not valid for comparing blob.


No it doesn't. Not when I try it.

What version of WMB are you using?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mbsa
PostPosted: Thu Dec 12, 2013 11:15 am    Post subject: Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

Yes you are right Victor.Thanks. I tried with binary now,it worked.I am in WMB 8.0.
Back to top
View user's profile Send private message
NealM
PostPosted: Tue Dec 17, 2013 5:47 pm    Post subject: Reply with quote

Master

Joined: 22 Feb 2011
Posts: 230
Location: NC or Utah (depends)

Now that you have your problem solved mbsa, I would like to mention that you could indeed have stored your MsgID in a database varchar column and later retrieve for compare to a CorrelID.
You would use this instruction to prepare the data for insert:
Code:
DECLARE vMSGID CHAR;
SET vMSGID = CAST(InputRoot.MQMD.MsgId AS CHARACTER);
(Note: Do NOT include a CCSID or Encoding). This will cast the BLOB as "pseudo-hex"
And you would use this instruction to prepare the retrieved database column for compare to a correlID or reuse:
Code:
SET OutputRoot.MQMD.MsgId = CAST(dbMSGID_CHAR AS BLOB)


We do this also for storing and retrieving a MsgID or HTTPRequestID as an element value in an XML document.
The trick is understanding the different behavior of the CAST with/without CCSID-Encoding.
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 » MsgID Comparision with CorrID
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.