Author |
Message
|
dinothedinamite |
Posted: Mon Jun 24, 2019 4:15 am Post subject: Creating new message with data from Oracle XE |
|
|
Guest
|
Hello, I'm learning about MQ and IIB in my new job and I've created an app that creates new message with data from Oracle XE db. Now I've tried the same app with DB2 db and it works fine. But when using Oracle XE as an example, one row of output message looks like this:
D\x00I\x00N\x00O
My ESQL code looks like this:
Code: |
CREATE COMPUTE MODULE test_mf_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
DECLARE myVar CHARACTER;
SET myVar = 'SELECT E.name, to_char(E.age) age, E.city, E.address FROM dkralj.employee E';
SET OutputRoot.XMLNSC.Test.Result[]=PASSTHRU(myVar);
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
|
Also I've noticed that when trying to either inserting or selecting integer data from database, IIB app throws errors and couldnt figure out why, so I started casting integers as characters.
Hopefully some of you might know why this is happening. Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jun 24, 2019 4:44 am Post subject: Re: Creating new message with data from Oracle XE |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dinothedinamite wrote: |
My ESQL code looks like this:
|
From a performance / best practice standpoint, avoid PASSTHRU if you can. Certainly save it for something more complicated than the simple SELECT that you're doing.
dinothedinamite wrote: |
Also I've noticed that when trying to either inserting or selecting integer data from database, IIB app throws errors and couldnt figure out why, so I started casting integers as characters.
Hopefully some of you might know why this is happening |
Well, if you gave a bit more information (like which of the several hundred errors IIB is capable of generating) we might be able to offer more assistance.
I would postulate that XML doesn't support anything other than character unless you've wedded it to an XSD. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
dinothedinamite |
Posted: Mon Jun 24, 2019 4:55 am Post subject: |
|
|
Guest
|
Quote: |
From a performance / best practice standpoint, avoid PASSTHRU if you can. Certainly save it for something more complicated than the simple SELECT that you're doing. |
When I ran select these are the results:
As you can see, there is space between each character and i dont know why.
You are right, I completely zoned out with this one and now that i did a simple select i saw that results are the same.
Lets forget the second issue that i've wrote but the error that i was getting wasnt iib error but oracle error. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jun 24, 2019 6:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dinothedinamite wrote: |
As you can see, there is space between each character and i dont know why. |
No I can't see because the corporate proxy I'm using doesn't allow images.
But I'll bet a small amount of money those are not spaces but the other byte of a double byte character set like UTF-16.
dinothedinamite wrote: |
Lets forget the second issue that i've wrote but the error that i was getting wasnt iib error but oracle error. |
And if you share the text of the Oracle error, we can tell which of the hundreds of possible Oracle errors it is and possibly assist. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 25, 2019 4:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looking at the fact that the language is most probably serbo-croatian (see the address in the pic), I wonder if we're dealing here with a CCSID issue.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 25, 2019 5:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
fjb_saper wrote: |
Looking at the fact that the language is most probably serbo-croatian (see the address in the pic), I wonder if we're dealing here with a CCSID issue.  |
Vitor wrote: |
Quote: |
As you can see, there is space between each character and i dont know why. |
I'll bet a small amount of money those are not spaces but the other byte of a double byte character set like UTF-16. |
_________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
dinothedinamite |
Posted: Tue Jun 25, 2019 11:30 pm Post subject: |
|
|
Newbie
Joined: 25 Jun 2019 Posts: 6
|
So if we are dealing with CCSID problem, how can I fix it? Someone got any ideas? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 26, 2019 4:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dinothedinamite wrote: |
So if we are dealing with CCSID problem, how can I fix it? Someone got any ideas? |
First, see what code page the Oracle database / tablespace is set to use and if it is, as is being postulated, a double byte or other non-Latin one. If so, make sure that the results are properly identified to IIB rather than allowing IIB to default to generic Latin.
Remember that internally, the message tree is always UTF-16 and there's nothing you can or would want to do about that. We're talking about the serializing and de-serializing of your results. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|