ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » About LENGTH function

Post new topic  Reply to topic
 About LENGTH function « View previous topic :: View next topic » 
Author Message
gecs
PostPosted: Mon Aug 20, 2012 10:14 am    Post subject: About LENGTH function Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Mon Aug 20, 2012 10:49 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mgk
PostPosted: Mon Aug 20, 2012 12:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Mon Aug 20, 2012 12:10 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

I see six possible fixes on this page:

http://www-01.ibm.com/support/docview.wss?uid=swg27019145

Not that any of these would apply to the OP.

One that may come close is:

http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg1IC78197

although the OP is not referring to the MQMD; it is possible the OP may need to open a PMR to get a fix.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Mon Aug 20, 2012 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
mgk
PostPosted: Mon Aug 20, 2012 12:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
gecs
PostPosted: Mon Aug 20, 2012 12:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
gecs
PostPosted: Mon Aug 20, 2012 12:34 pm    Post subject: Reply with quote

Acolyte

Joined: 14 Nov 2007
Posts: 58

Thanks "mqjeff" and "mgk"... you're right.

Regards.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Aug 20, 2012 12:38 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

gecs wrote:
MQSI 7.0.0.1


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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » About LENGTH function
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.