Author |
Message
|
gecs |
Posted: Mon Aug 20, 2012 10:14 am Post subject: About LENGTH function |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
Hi everybody. I'm trying to get the character length using LENGTH function, but it shows me "another value".
I expose a service that receives a Base64 encoded string. Then, I decode the data and CAST to CHARACTER for put it on a queue.
My questions is:
- Why when I use the LENGTH function with the data (CHARACTER) it results "1253", but when I see it in log (trace) it shows me more characters (1694).
I don't know why this happens. What am I doing wrong?
P.D: I attach an image of the trace (The encoded string is an image)
Thanks in advance.
 |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Aug 20, 2012 10:49 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
What version of broker runtime (broker versions have four digits). What is the "effective level" of your runtime? There are many esql string length bug fixes up through 7.0.0.5, especially when these strings have MBCS. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mgk |
Posted: Mon Aug 20, 2012 12:00 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
There are many esql string length bug fixes up through 7.0.0.5 |
Really? Care to point me to one, as I'm not aware of any... _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Aug 20, 2012 12:10 pm Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Aug 20, 2012 12:19 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'm confused.
It's an image? That's been base64 decoded, and then attempted to be treated as a string?
It should be base64 decoded into a BLOB. The length of the BLOB is then the correct number of bytes that make up the image, rather than the number of characters in a character set that has no relation to the actual contents of the image. |
|
Back to top |
|
 |
mgk |
Posted: Mon Aug 20, 2012 12:22 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Yes, I see six mentions of the word length as well, but none of them are to to with the LENGTH function in ESQL .
Back to the original question, can you post the ESQL you are using and an example of the user trace that shows the length of the string. How do you know the length is wrong - is it that the viewer is interpreting a \r as \r\n for example?
Question. If the base64 encoded data is a binary image, surely a BLOB would be better a CHARACTER?
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
gecs |
Posted: Mon Aug 20, 2012 12:31 pm Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
Thanks for your response "lancelotic", the version is:
MQSI 7.0.0.1
I was reviewing and the data and length is OK. My co-worker told me: "one thing is the physical data and other thing is how a program show it... (in this case notepad++)", well this is a little confuse for me... I guess I will investigate more....
Regards! |
|
Back to top |
|
 |
gecs |
Posted: Mon Aug 20, 2012 12:34 pm Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
Thanks "mqjeff" and "mgk"... you're right.
Regards. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Aug 20, 2012 12:38 pm Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Update your runtime to at least 7.0.0.4. And you did not state what your "effective level" is. Use mqsireportbroker to find out. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|