Author |
Message
|
AJStar |
Posted: Mon Jul 09, 2007 10:29 pm Post subject: Retrieving BLOB message from Database using ESQL |
|
|
 Acolyte
Joined: 27 Jun 2007 Posts: 64
|
Scenario:
(1) XML message received in input queue.
(2) Domain is MRM.
(3) Message converted to BLOB using following statement...
DECLARE InputMsg_Blob BLOB ASBITSTREAM(InputRoot, InputRoot.Properties.Encoding, InputRoot.Properties.CodedCharSetId);
(4) BLOB data inserted into DB (there is a BLOB column in DB table).
Problem:
(a) I want to retrieve the BLOB data.
(b) Cast it to character.
(c) Send the xml message to output queue.
Since the message goes in with the header too, is it possible to retrieve the message and perform (b) & (c) that I have mentioned?
Any inputs on this will be very helpful.
Thanks, AJ |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 10, 2007 2:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Why? Just retrieve the Blob, set the CCSID and encoding to match the data in the Blob and output the Blob to the queue. Casting to char will only meddle things. If you want to inspect the XML data you would need to PARSE the Blob before sending it to the output queue.... Use either XMLNS or MRM parser...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
au@kosa |
Posted: Tue Jul 10, 2007 5:53 am Post subject: |
|
|
 Centurion
Joined: 04 Jan 2007 Posts: 103 Location: pune
|
You can acheive it using RCD node . Configure the RCD node to change the input BLOB domain to XML or XMLNS domain. _________________ Regards,
au@kosa
IBM Certified SOA Solution Designer/Associate |
|
Back to top |
|
 |
wbi_telecom |
Posted: Tue Jul 10, 2007 7:17 am Post subject: |
|
|
 Disciple
Joined: 15 Feb 2006 Posts: 188 Location: Harrisburg, PA
|
Or use CREATE and PARSE on the BLOB using appropriate CCSID and Encoding.
Cheers, |
|
Back to top |
|
 |
AJStar |
Posted: Tue Jul 10, 2007 9:28 pm Post subject: Retrieving BLOB message from Database using ESQL |
|
|
 Acolyte
Joined: 27 Jun 2007 Posts: 64
|
Thanks for all your inputs.
All your suggestions work fine... but only when the xml message that has been converted to blob and inserted into DB has gone in without the message header.
While trying to retrieve the message in such a case, and then parse it, it fails. Please note that retrieving the message from DB is not the problem, but I do not want the hexadecimal data (blob) that it gives. That is why I am trying to cast or parse, to change it back to the readable xml message. This works fine only when the message has gone in without the message header.
Any suggestions on this ?
Thanks, AJ |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jul 11, 2007 4:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So what you're saying is, when you retrieve a blob of data that is described by two different parsers (MQMD and XML), and then try to parse it using only one of them (XML), then it doesn't work?
Maybe you should save the headers separately. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|