Author |
Message
|
giorginus80 |
Posted: Thu Apr 02, 2009 1:49 am Post subject: Convert whole Message MRM to BLOB |
|
|
 Centurion
Joined: 08 Jul 2008 Posts: 124 Location: Rome, Italy
|
Hi,
Lazy question, how can I parse whole Message in the MRM domain into a BLOB (I need to put it in an Blob Oracle Field).
I tried with
Code: |
DECLARE rispostaBitStream BLOB
CAST(ASBITSTREAM(InputRoot.MRM
OPTIONS parseOptions
SET 'mySet'
TYPE 'myType'
FORMAT 'XML') AS BLOB);
|
But I have <MRM></MRM> tags at start and ends, how can I solve?
Thanks in advance |
|
Back to top |
|
 |
kimbert |
Posted: Thu Apr 02, 2009 2:07 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Ask yourself these questions:
- What data type does ASBITSTREAM return?
- What should parseOptions be set to? ( I have no idea how you are setting it, you omitted that line of code ).
- Is it possible that the message tree really is empty? How would you find out?
- Are the parameters to ASBITSTREAM correct? How would you find out? Hint: User trace is really useful. |
|
Back to top |
|
 |
giorginus80 |
Posted: Thu Apr 02, 2009 2:10 am Post subject: |
|
|
 Centurion
Joined: 08 Jul 2008 Posts: 124 Location: Rome, Italy
|
I changed
Code: |
DECLARE rispostaBitStream BLOB
CAST(ASBITSTREAM(InputRoot.MRM
OPTIONS parseOptions
SET 'mySet'
TYPE 'myType'
FORMAT 'XML') AS BLOB);
|
with
Code: |
DECLARE rispostaBitStream BLOB
CAST(ASBITSTREAM(InputRoot.MRM
OPTIONS parseOptions
SET InputRoot.Properties.MessageSet
TYPE InputRoot.Properties.MessageType
FORMAT InputRoot.Properties.MessageFormat) AS BLOB);
|
and with worked, I don't know why but with the first method the tags <MRM></MRM> are put in the field oracle blob...with the second method no tags. Strange beahviour. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Thu Apr 02, 2009 2:18 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Arent you curious as to why it worked? Whats your theory on this?
Just out of interest, what was your answer to Kimberts first question....
Quote: |
What data type does ASBITSTREAM return |
|
|
Back to top |
|
 |
giorginus80 |
Posted: Thu Apr 02, 2009 2:23 am Post subject: |
|
|
 Centurion
Joined: 08 Jul 2008 Posts: 124 Location: Rome, Italy
|
kimbert wrote: |
- What data type does ASBITSTREAM return?
|
The same of the InputRoot.MRM, I have an MRM in a xml format ( may be it was better using XMLNSC domain I know)
kimbert wrote: |
- What should parseOptions be set to?
|
I used:
Code: |
DECLARE parseOptions INTEGER BITOR(FolderBitStream, ValidateContent, ValidateValue, ValidateLocalError);
|
|
|
Back to top |
|
 |
WMBDEV1 |
Posted: Thu Apr 02, 2009 3:00 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Ok, i'll ask one more time and then I promise no more.....
giorginus80 wrote: |
kimbert wrote: |
- What data type does ASBITSTREAM return?
|
The same of the InputRoot.MRM |
If ASBITSTREAMs return data type is the same as InputRoot.MRM then why use it ASBITSTREAM all? InputRoot.MRM is a message tree, what is ASBITSTREAMs?
and if all you changed was:
Code: |
SET InputRoot.Properties.MessageSet
TYPE InputRoot.Properties.MessageType
FORMAT InputRoot.Properties.MessageFormat |
What do these evaluate to? |
|
Back to top |
|
 |
giorginus80 |
Posted: Thu Apr 02, 2009 3:08 am Post subject: |
|
|
 Centurion
Joined: 08 Jul 2008 Posts: 124 Location: Rome, Italy
|
I don't know why in this way I solved the tags problem.
In the Properties.Message* are the same values that I passed before, but when I look in the blob written in the db field I had the MRM tags (if I write the ASBITSTREAM parameters in the other way! |
|
Back to top |
|
 |
kimbert |
Posted: Thu Apr 02, 2009 4:41 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
- Remove the CAST statement. It is CASTing a BLOB to a BLOB. My first question was trying to help you to realize that for yourself.
- You are setting the parserOptions variable incorrectly. Please look carefully at what you have done, because the mistake should be obvious. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Thu Apr 02, 2009 4:44 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
kimbert wrote: |
- Remove the CAST statement. It is CASTing a BLOB to a BLOB. My first question was trying to help you to realize that for yourself.
|
.....and so were my follow on questions!!!!! |
|
Back to top |
|
 |
|