|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DB updates where data includes apostrophes. |
« View previous topic :: View next topic » |
Author |
Message
|
jgooch |
Posted: Mon Mar 17, 2003 8:08 am Post subject: DB updates where data includes apostrophes. |
|
|
 Acolyte
Joined: 29 May 2002 Posts: 63 Location: UK
|
This is related to my last topic (about issues with the v2.1 XML parser) but I noticed that the way it was displayed on the forum was pretty unreadable.
I have a specific question to resolve our issue:-
How can we get the following ESQL to work when the incoming data (in MESSAGEDETAIL) has an apostrophe inside?
Quote: |
UPDATE Database.V_RS_FAILED_MESSAGE AS F
SET MESSAGE_DETAIL = Body.MESSAGEDETAIL
WHERE F.MESSAGE_ID = CAST(DestinationList.MessageID AS INTEGER); |
I've tried to write some code to replace any apostrophes with the entity ' (since the underlying data is XML) but how can you code ' in ESQL?
The only alternative I've thought of so far is to search a BLOB for X'27' but this seems really clunky.
Thanks,
J. |
|
Back to top |
|
 |
yaakovd |
Posted: Wed Mar 19, 2003 11:45 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
I think that BLOB is the best solution here. Why change data???
Use BLOB field in DB and
Code: |
UPDATE Database.V_RS_FAILED_MESSAGE AS F
SET MESSAGE_DETAIL = BITSTREAM(Body.MESSAGEDETAIL)
WHERE F.MESSAGE_ID = CAST(DestinationList.MessageID AS INTEGER); |
_________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
Back to top |
|
 |
jgooch |
Posted: Thu Mar 20, 2003 2:07 am Post subject: |
|
|
 Acolyte
Joined: 29 May 2002 Posts: 63 Location: UK
|
Yaakov,
Many thanks for the reply.
However, trying to write a BISTREAM to the database doesn't work without changing the data model (and who knows what knock on effect that may have on the application running over the DB?).
The ODBC error is:-
Quote: |
'[MERANT][ODBC Sybase ASE driver][SQL Server]Operand type clash: IMAGE is incompatible with TEXT' |
It's all a bit annoying since the only reason we've hit this problem in the first place is because v2.1 is not backwards compatible with v2.0.1.
I've created a version of the flow that performs entity substitutions on the apostophes in the data (by running through the BLOB looking for x'27'). It works, but at the end of the day it's a fudge.
J. |
|
Back to top |
|
 |
yaakovd |
Posted: Thu Mar 20, 2003 3:09 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
J.
You absolutelly right that you must change your Data model to BLOB.
It makes some problem to use the data from external applications. Also there some different format between MQSI 2.0.2 and 2.1, which also problematic for using by external applications.
In my case only MQSI use it. _________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|