Author |
Message
|
brgmo |
Posted: Wed Dec 12, 2007 1:51 am Post subject: BLOB cast failure |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Hi All,
I am trying to cast a character to blob and i get the following error:
String is not of correct form for byte array. Must consist even number contents.
Any idea what is the problem.
Regards
brgmo. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 1:53 am Post subject: Re: BLOB cast failure |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
brgmo wrote: |
Any idea what is the problem. |
I'm just guessing but.....
brgmo wrote: |
Must consist even number contents. |
leads me to wonder if you have a padding issue. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
brgmo |
Posted: Wed Dec 12, 2007 2:10 am Post subject: |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Vitor,it's just i am casting a charcter string to blob.I am not using any message set or any other mb stuff.I am trying to create a correlation id for a message and that's the time when it throws this error.
Regards
brgmo. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 2:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
brgmo wrote: |
I am trying to create a correlation id for a message and that's the time when it throws this error.
|
Why? There are any number of discussions in the forum about why this is a bad idea from a design concept.
Also (as you've discovered) it doesn't work the way you think it does. What you need is the hex representation of the string, and remember that it's not converted between platforms, so may not look the same on a different target.
I struggle to think what requirement you're trying to fulfil. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
brgmo |
Posted: Wed Dec 12, 2007 2:55 am Post subject: |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Vitor, i have a character string 'ABC2007121210525252'.I have to store this as correlation id.I am able to converts that to binary format using ccsid 1208.But when the flow tries to put the message on the queue,it throws an exception
The length must be correct.
So,my question is it is neccessary to keep the correlation id filed to be 24 because my string length is just 19.
Regards
brgmo. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 3:18 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
brgmo wrote: |
i have a character string 'ABC2007121210525252'.I have to store this as correlation id. |
Why???
brgmo wrote: |
So,my question is it is neccessary to keep the correlation id filed to be 24 because my string length is just 19.
|
Yes. It's a 24 byte field.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
brgmo |
Posted: Wed Dec 12, 2007 3:21 am Post subject: |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
The business requirements are like this.They want the below mentioned field to be passed as a correlation id. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 3:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
brgmo wrote: |
The business requirements are like this.They want the below mentioned field to be passed as a correlation id. |
Yes, but just because the business want it doesn't make it a good idea. Push back, tell them it's a stupid idea & anti-pattern then ask them what they actually need.
"We want the correlation id set to this value" is not a business requirement - it's a design decision. Business should not do design. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
brgmo |
Posted: Wed Dec 12, 2007 3:47 am Post subject: |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Well you know,Vitor as how the things work with clients.My Clients are very adamant and if we ask them to change anything,they make a big noise and then a series of meetings will happen to justify ourselves.So,i feel it's better to do what they ask to avoid any kind of hassle. But anyways i have padded the correlation id with 5 blanks and now it's working fine.Thanks for your help.
Regards
brgmo. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 3:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
brgmo wrote: |
Well you know,Vitor as how the things work with clients. |
Yes, clients employ you to gain expertise in areas they lack. There is an instinctive desire to micro-manage, but it's the IT equivalent of watching a plumber fix a pipe and advising him what kind of solder to use. The meetings are just a cheap tactic to wear you down; I quite enjoy watching them proudly putting up their stupid designs and silly justifications so I can knock them down. But that's me.
brgmo wrote: |
So,i feel it's better to do what they ask to avoid any kind of hassle. |
It's worth pointing out (if only for the record and the benefit of future readers) that you're not avoiding hassle, you're just postponing it to the day when you need to use correlation id for a purpose inimicable with it being a business string.
But you must of course do what you feel is best.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|