Author |
Message
|
mfbws61 |
Posted: Wed Oct 07, 2009 10:55 pm Post subject: Unreadable characters stored in DB2 when issued INSERT ESQL |
|
|
Newbie
Joined: 07 Oct 2009 Posts: 3
|
I am issuing following ESQL statement from WMB. Database server and WMB are installed on same OS (RHEL 5). Issue is that when i select records from database, i see distorted characters.
ESQL Command:
INSERT INTO Database.MSGSTORE.MQSIUSER.COMPLAIN(MSGID,RECEIVED,MESSAGE) VALUES(Root.MQMD.MsgId, CURRENT_TIMESTAMP, ASBITSTREAM(Root));
Kindly note that CURRENT_TIMESTAMP field is showing right characters.
Would appreciate your help |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Oct 07, 2009 11:01 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You are not using ASBITSTREAM correctly. |
|
Back to top |
|
 |
mfbws61 |
Posted: Thu Oct 08, 2009 1:09 am Post subject: |
|
|
Newbie
Joined: 07 Oct 2009 Posts: 3
|
mqjeff wrote: |
You are not using ASBITSTREAM correctly. |
But Root.MQMD.MsgId is distorted as well.... |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Oct 08, 2009 1:19 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
What are the datatypes of the DB2 table you are trying to insert into
This WILL have a bearing upon the way you do the insert (esql code etc)
I have done this several times and a little experimentation does work wonders. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mfbws61 |
Posted: Thu Oct 08, 2009 1:24 am Post subject: |
|
|
Newbie
Joined: 07 Oct 2009 Posts: 3
|
smdavies99 wrote: |
What are the datatypes of the DB2 table you are trying to insert into
This WILL have a bearing upon the way you do the insert (esql code etc)
I have done this several times and a little experimentation does work wonders. |
All data types are of CHARACTER type. I tried experimenting a lot but my zero experience of broker is hampering a lot. |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Oct 08, 2009 1:33 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
All data types are character eh?
Well for starters, MQMD.MsgId is a BINARY Field. It is not character.
Also, If you plan of retreiving the Message body, I'd store it as a BINARY(BLOB) as well. This way you don't run into character conversion issue. You know the sort of thing we seem to be seeing on this forum on a regular basis.
Obviously this may be impractical in your particular installation but I have to say that using my method has been in daily use for some 2 years without ANY problems.
The Message I'm storing contains an encrypted Binary64 field as well as XML data. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Oct 08, 2009 7:18 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mfbws61 wrote: |
I tried experimenting a lot but my zero experience of broker is hampering a lot. |
It will; WMB is not the easiest piece of software to pick up and I urge you to obtain some training. Or you'll find yourself hampered in a number of directions, and development will be a long and painful process for you. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|