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 » SQL text field To WMB BLOB

Post new topic  Reply to topic
 SQL text field To WMB BLOB « View previous topic :: View next topic » 
Author Message
mustang
PostPosted: Tue May 08, 2007 9:02 am    Post subject: SQL text field To WMB BLOB Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 72

We warehouse messages to a text field in MS SQL Server. We need to read the message from the db and write it to a queue. We can get the message out of the db OK, but are having difficulty creating a message out of it. I assume this is a CHAR to BLOB conversion problem. Below is the code we are trying:

SET Environment.Variables.Messages VALUE = null;
Create Lastchild Of Environment.Variables.Messages Domain 'BLOB' Name 'BLOB';

SET OutputLocalEnvironment.Variables.MESSAGE[] =
( SELECT Top 1
T.PASS_THRU_TXT AS "ORIGMSG"
FROM Database.Request_Audit AS T
);

Set Environment.Variables.Messages.BLOB = Cast(ASBitstream(OutputLocalEnvironment.Variables.MESSAGE.ORIGMSG,
InputProperties.Encoding,
InputProperties.CodedCharSetId,'','','',FolderBitStream) As BLOB);


OutputLocalEnvironment.Variables.MESSAGE.ORIGMSG appears to store the message as a character type.
Environment.Variables.Messages.BLOB ends up storing ''.

We use MS SQL Server 2000 and WMB6.

Any help would be much appreciated.

Thanks!!!!!!!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue May 08, 2007 9:07 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Um.

You've presumably already fetched the BITSTREAM, so you don't need to serialize it as a bitstream again, right?

You need to *parse* it?

So either use CREATE FIELD ... PARSE or just Set OutputRoot.BLOB.BLOB = the message data.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mustang
PostPosted: Tue May 08, 2007 12:36 pm    Post subject: Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 72

That did the trick. 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 » SQL text field To WMB BLOB
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.