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 » logginf message data , blob and msgid

Post new topic  Reply to topic
 logginf message data , blob and msgid « View previous topic :: View next topic » 
Author Message
ramires
PostPosted: Tue Jun 04, 2002 7:45 pm    Post subject: logginf message data , blob and msgid Reply with quote

Knight

Joined: 24 Jun 2001
Posts: 523
Location: Portugal - Lisboa

Hi,
I want to store in db2 some info about messages, like putdate, putime, replyq, msgid and data, but i'm having some problems with the data and msgid.
the data is xml, and i'm not finding and easy way to convert xml (tags included) to a big string to do the database INSERT.
With the msgid i'm having problems because it is a BLOB, and i want to store is as a CHAR. I'm doing this

INSERT
INTO Database.LOGDATA(TIMESTAMP, MESSAGEID, REPLYTOQ, REPLYTOQMGR) VALUES
(
SUBSTRING(CAST(Root.MQMD.PutDate AS CHAR) FROM 7 FOR 10) || SUBSTRING(CAST(Root.MQMD.PutTime AS CHAR) FROM 10 FOR 12),
CAST (Root.MQMD.MsgID AS CHARACTER),
Root.MQMD.ReplyToQ,
Root.MQMD.ReplyToQMgr

);

Is it possible ? Some help ...?

Thanks !
Back to top
View user's profile Send private message
kolban
PostPosted: Tue Jun 04, 2002 7:53 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Be aware that when you cast a BLOB to a CHAR you get data of the format

X'0123456789ABCDEF'

for binary data

0123456789ABCDEF

so, if you had expected the 24 byte BLOB to become a 24 character string, that would be a mistake. Instead you will get a

48 + "X'" + "'" = 51 character string
Back to top
View user's profile Send private message
ramires
PostPosted: Tue Jun 04, 2002 8:00 pm    Post subject: Reply with quote

Knight

Joined: 24 Jun 2001
Posts: 523
Location: Portugal - Lisboa

Thanks,

but for example if using a trace node i can see in the trace msgid like
X'414d51204d515349514d2020202020209a77fd3c22300200' .
Is this what I want to log in db2, how to obtain it from the
MQMD ?
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Jun 04, 2002 8:36 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

It is upto you whether you want to log MsgId as CHAR or BLOB int db.

As kolban said, if you want to log it as BLOB you will get 48 bytes BLOB data, i.e. MQMD.MsgId will be stored as 414d51204d515349514d2020202020209a77fd3c22300200 into BLOB column. If you want to store MQMD.MsgId as CHAR then yor Insert statement remains same. There you are already casting it to CHAR. In database value will be stored as X'414d51204d515349514d2020202020209a77fd3c22300200'. In this case DB colum should hav length not less than 51 chars.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
ramires
PostPosted: Wed Jun 05, 2002 12:07 am    Post subject: Reply with quote

Knight

Joined: 24 Jun 2001
Posts: 523
Location: Portugal - Lisboa

ok, I understand the diference between BLOB and CHAR, what I don't understand is this (part of a trace) where I can see Root.MQMD.MsgID = NULL, and for the same message using a TRACE node I with pattern${Root} I have a correct message id

file="F:\build\S210_P\src\DataFlowEngine\ImbRdl\ImbRdlFieldRef.cpp" line="1234">
<Insert type="integer">8</Insert>
<Insert type="integer">10</Insert>
<Insert type="string">Root.MQMD.MsgID</Insert>
<Insert type="string">LoggingXML.Database1</Insert>
</UserTrace>
- <UserTrace timestamp="2002-06-05 08:19:18.127000" thread="2800" function="SqlPath::navigateCursorFirst" type="ComIbmDatabaseNode" name="ecce2c3e-ee00-0000-0080-bd7f0c6dfb9a" label="LoggingXML.Database1" text="Cannot navigate path element" catalog="WMQIv210" number="2543" file="F:\build\S210_P\src\DataFlowEngine\ImbRdl\ImbRdlFieldRef.cpp" line="958">
<Insert type="integer">8</Insert>
<Insert type="integer">20</Insert>
<Insert type="string">LoggingXML.Database1</Insert>
</UserTrace>
- <UserTrace timestamp="2002-06-05 08:19:18.127000" thread="2800" function="SqlTypeCast::scalarEvaluate" type="ComIbmDatabaseNode" name="ecce2c3e-ee00-0000-0080-bd7f0c6dfb9a" label="LoggingXML.Database1" text="Evaluation result '%1' = '%2'" catalog="WMQIv210" number="2539" file="F:\build\S210_P\src\DataFlowEngine\ImbRdl\ImbRdlTypeCast.cpp" line="189">
<Insert type="integer">8</Insert>
<Insert type="integer">4</Insert>
<Insert type="string">CAST(NULL AS CHARACTER )</Insert>
<Insert type="string">NULL</Insert>
<Insert type="string">CAST(Root.MQMD.MsgID AS CHARACTER)</Insert>
<Insert type="string">LoggingXML.Database1</Insert>

!!!! and after doing the trace I found (so many hours...) the error !!!!
the diference is:

CAST(Root.MQMD.MsgID AS CHARACTER)
CAST(Root.MQMD.MsgId AS CHARACTER)

A 5 hours 'D'....

Thanks

Another question, how to convert a xml tagged message to a big string ?
Back to top
View user's profile Send private message
Tibor
PostPosted: Wed Jun 05, 2002 12:50 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Quote:
Another question, how to convert a xml tagged message to a big string ?


Try this:

Code:

cast(bitstream(InputBody) as character ccsid 1208)


Codepage value (1208) may be other. Better (transportable) solution can be e.g. InputRoot.MQMD.CodedCharSetId.
Back to top
View user's profile Send private message
ramires
PostPosted: Wed Jun 05, 2002 2:11 pm    Post subject: Reply with quote

Knight

Joined: 24 Jun 2001
Posts: 523
Location: Portugal - Lisboa

Thanks to all, your answers were a good help

joao
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 » logginf message data , blob and msgid
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.