Author |
Message
|
vijayakumar |
Posted: Thu Apr 21, 2011 4:48 am Post subject: version to 6.1 - assigning values |
|
|
Centurion
Joined: 01 Aug 2010 Posts: 101
|
In version 5, we have a message set which is having the element as T_val with datatype as xsd:string
and have the code used it as
Set OutputRoot.MRM.T_val = X'0a'; which is working fine.
If we upgrade into version 6 and used the same message set and code.
But getting error as "Type not equal to String"
could you please help us whether any compatibility with the versions causing the issue. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 21, 2011 5:00 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's likely that the 6.1 is doing better validation than the 5.0 ESQL editor did.
Try
Code: |
--see how using code tags is nice?
Set OutputRoot.MRM.T_val VALUE=X'0a';
-- OR
Set OutputROot.MRM.T_val = CAST(X'0a' as CHARACTER); |
|
|
Back to top |
|
 |
vijayakumar |
Posted: Thu Apr 21, 2011 7:59 am Post subject: |
|
|
Centurion
Joined: 01 Aug 2010 Posts: 101
|
I need to convert the X'0a'.
If i give the code as such as you gave,
the o/p, getting as it is X'0a' . But i need to get the value for that.
Thanks |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 21, 2011 8:05 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Right. I forgot to set a CCSID on the CAST.
I assume that the VALUE clause caused the same problem as the normal case? |
|
Back to top |
|
 |
khudania |
Posted: Wed Apr 27, 2011 6:46 am Post subject: |
|
|
 Apprentice
Joined: 30 Nov 2004 Posts: 43
|
I have used the below code in one of my projects. This is working code from a 6.1 MB flow.
Quote: |
DECLARE chrNextLine CHAR CAST(CAST('X''0A''' AS BLOB) AS CHAR CCSID refMsgIn.Properties.CodedCharSetId Encoding refMsgIn.Properties.Encoding DEFAULT 'CAST FAILED'); |
I have then assigned chrNextLine wherever I had to use the next line caret return.
hope this would help to solve your problem. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Apr 27, 2011 6:48 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
That code is doing a significant amount of extra work for no added value. |
|
Back to top |
|
 |
khudania |
Posted: Wed Apr 27, 2011 6:56 am Post subject: |
|
|
 Apprentice
Joined: 30 Nov 2004 Posts: 43
|
mqjeff wrote: |
That code is doing a significant amount of extra work for no added value. |
You mean this part
Quote: |
CAST('X''0A''' AS BLOB)
|
This part was meant to convert a string to the caret VALUE blob.
rest all is preity standard. |
|
Back to top |
|
 |
vijayakumar |
Posted: Wed Apr 27, 2011 12:12 pm Post subject: |
|
|
Centurion
Joined: 01 Aug 2010 Posts: 101
|
Thanks khudiana .
how i can set the value for ccsid and encoding in the code,since we dont have the values from the properties of the message tree.
can we directly assign the ccsid as 819. |
|
Back to top |
|
 |
vijayakumar |
Posted: Wed Apr 27, 2011 12:41 pm Post subject: |
|
|
Centurion
Joined: 01 Aug 2010 Posts: 101
|
As you gave, the code is used below
DECLARE Endchr CHAR CAST(CAST('X''0A''' AS BLOB) AS CHAR CCSID InputRoot.Properties.CodedCharSetId ENCODING InputRoot.Properties.Encoding);
Set OutputRoot.XML.DocTX.Eline=Endchr;
The output for this coming as . |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 27, 2011 12:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
vijayakumar wrote: |
The output for this coming as . |
Coming as '.' in what sense? Many message viewers use '.' for values which can't be represented as printable characters.
What's the actual value? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
vijayakumar |
Posted: Wed Apr 27, 2011 1:08 pm Post subject: |
|
|
Centurion
Joined: 01 Aug 2010 Posts: 101
|
The value of Endchr is coming as . (instead of next line caret return) after it is casted |
|
Back to top |
|
 |
vijayakumar |
Posted: Thu Apr 28, 2011 3:59 am Post subject: |
|
|
Centurion
Joined: 01 Aug 2010 Posts: 101
|
Sorry, the value of
Set OutputRoot.MRM.DocTX.Eline=Endchr;
is not coming as <LF> instead it is coming as . |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 28, 2011 4:02 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
the character "." is likely being used to indicate "a non-visible" character, and thus is actually the <lf> character. |
|
Back to top |
|
 |
khudania |
Posted: Thu Apr 28, 2011 4:40 am Post subject: |
|
|
 Apprentice
Joined: 30 Nov 2004 Posts: 43
|
vijayakumar wrote: |
Sorry, the value of
Set OutputRoot.MRM.DocTX.Eline=Endchr;
is not coming as <LF> instead it is coming as . |
Just for trial,
SET C = 'A'||Endchr||'B';
Print this to log file or may be see in the debugger to check if A and B are separated by <lf> or a character '.' _________________ If the doors of perception were cleansed, everything would appear as it is - infinite |
|
Back to top |
|
 |
|