|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
SQL text field To WMB BLOB |
« View previous topic :: View next topic » |
Author |
Message
|
mustang |
Posted: Tue May 08, 2007 9:02 am Post subject: SQL text field To WMB BLOB |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue May 08, 2007 9:07 am Post subject: |
|
|
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 |
|
 |
mustang |
Posted: Tue May 08, 2007 12:36 pm Post subject: |
|
|
Acolyte
Joined: 07 Feb 2006 Posts: 72
|
That did the trick. Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|