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 » IBM MQ API Support » save messageID to databse

Post new topic  Reply to topic
 save messageID to databse « View previous topic :: View next topic » 
Author Message
crayon_coco
PostPosted: Mon Oct 20, 2003 2:11 am    Post subject: save messageID to databse Reply with quote

Apprentice

Joined: 08 Oct 2003
Posts: 33

hi!
after put the message into the queue, how do i save the messageID which is a type of byte array into the database eg. sql server?
should i convert it into string first?
Back to top
View user's profile Send private message
rwa
PostPosted: Mon Oct 20, 2003 3:50 am    Post subject: Reply with quote

Voyager

Joined: 22 Jan 2002
Posts: 76
Location: Duesseldorf/Germany

Hi cocolua,

the field MsgID has the format MQBYTE24. This field should be copied into a binary/blob field of a database. A MsgID field cannot be converted into a string field.

With microsoft sql server the field format binary[24] or varbinary[24] can be used.

Regards,

Rainer
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jefflowrey
PostPosted: Mon Oct 20, 2003 5:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

rwa wrote:
the field MsgID has the format MQBYTE24.
This is true.
rwa wrote:
This field should be copied into a binary/blob field of a database.
This is only true for some application designs.
Quote:
A MsgID field cannot be converted into a string field.
This is not true at all. Yes, it's true that a MessageID field can (and will, if generated by MQSeries) contain "non-printable"/"non-string" characters. But it's very easy to encode those so they can be stored in a string field. Particularly in VisualBasic, you can ask for the MessageIdHex property, which will give you a 48-character string that contains the hex encoding of the MessageId.

rwa wrote:
With microsoft sql server the field format binary[24] or varbinary[24] can be used.
Or, a char[48].
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
rwa
PostPosted: Mon Oct 20, 2003 6:32 am    Post subject: Reply with quote

Voyager

Joined: 22 Jan 2002
Posts: 76
Location: Duesseldorf/Germany

Just to complete my picture (I do not know VisualBasic),

is it possible decode string into the binary format?

How does this encoding work? This would be helpful if the database should be read with another programming language.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jefflowrey
PostPosted: Mon Oct 20, 2003 6:59 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

rwa wrote:
Just to complete my picture (I do not know VisualBasic),

is it possible decode string into the binary format?

How does this encoding work? This would be helpful if the database should be read with another programming language.


Well, in Visual Basic, you can use the various ...Hex properties (MessageIdHex, CorrelIdHex, AccountingTokenHex,...) properties as both "getters" and "setters". That is, I can insert the value of MessageIdHex into a table, and then later on retrieve that value and put it back into MessageIdHex.

But you can do byte to hex character conversions in any language. You just go through each byte, and figure out what the hex representation of that byte value is, and append those two characters to a string.

And a lot of programming environments have presupplied code to do this for you.
_________________
I am *not* the model of the modern major general.
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 » IBM MQ API Support » save messageID to databse
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.