|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
No error thrown when DataBase update done with Cast & CC |
« View previous topic :: View next topic » |
Author |
Message
|
shalabh1976 |
Posted: Fri May 09, 2003 7:42 am Post subject: No error thrown when DataBase update done with Cast & CC |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
I tried to update the Database with the following syntax:
UPDATE DataBase.SCHEMA.TABLE AS A SET MSGDATA = InputRoot.BLOB.BLOB where A.MSGID = CAST(InputRoot.MQMD.CorrelId as CHAR CCSID 437);
MSGDATA is a BLOB field.
MSGID is a CHAR field
This update did not take place.
No SQL error was reported(SQLCODE = 0) nor
did the EVENT VIEWER report any error.
However when I removed the CCSID clause this worked.
I have used the CAST with CCSID 437 in a lot of places in my code and it works everywhere but not here.
Can somebody tell me whats going on ? |
|
Back to top |
|
 |
kirani |
Posted: Fri May 09, 2003 4:12 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Could you post your insert ESQL statement here?
I think, It didn't update the record in the DB because it couldn't find the matching row. "Row not found" is not an error, so no exception will be thrown by WMQI. You can configure the node in such a way that it will throw an excpetion when it receives DB warnings. This can be done by selecting "Throw Warning on DB errors" checkbox in advanced tab.
By using CCSID option in CAST statement you are actually converting the BLOB data to CHAR, which may not be matching with what you have stored in the DB. That's why it's important to look at your insert statement and DB schema. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
shalabh1976 |
Posted: Mon May 12, 2003 7:25 am Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Kirani,
Thanks for your prompt response, as always.
I thought that "No record found" mapped to sqlcode +100 so if the query did not find a corresponding record, it should have returned this value.
Also when I checked for the Insert statement it is using a CAST without a CCSID.
This explains why the UPDATE failed.
Shouldn't this default to 437 for NT ?
So does this mean that CAST('ABCD' AS CHAR) <> CAST('ABCD' AS CHAR CCSID 437) for NT ? |
|
Back to top |
|
 |
kirani |
Posted: Mon May 12, 2003 11:06 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
shalabh1976 wrote: |
I thought that "No record found" mapped to sqlcode +100 so if the query did not find a corresponding record, it should have returned this value.
|
Yes, it should. SQL variables in ESQL are populated only when you don't select "Throw Errors on DB Errors" in Advanced tab of the Compute/DB node.
shalabh1976 wrote: |
So does this mean that CAST('ABCD' AS CHAR) <> CAST('ABCD' AS CHAR CCSID 437) for NT ?
|
Yes, that's correct. These two statements are not same.
CAST('ABCD' AS CHAR) will convert the first operand (literal string) to CHARACTER data type.
CCSID option is used to convert specific data types (for example, BLOB) to CHAR format. So the statement CAST(X'41' AS CHAR CCSID 437) will return CHAR 'A'. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
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
|
|
|
|