ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Creating new message with data from Oracle XE

Post new topic  Reply to topic
 Creating new message with data from Oracle XE « View previous topic :: View next topic » 
Author Message
dinothedinamite
PostPosted: Mon Jun 24, 2019 4:15 am    Post subject: Creating new message with data from Oracle XE Reply with quote

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
PostPosted: Mon Jun 24, 2019 4:44 am    Post subject: Re: Creating new message with data from Oracle XE Reply with quote

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
View user's profile Send private message
dinothedinamite
PostPosted: Mon Jun 24, 2019 4:55 am    Post subject: Reply with quote

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
PostPosted: Mon Jun 24, 2019 6:08 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Jun 25, 2019 4:48 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Jun 25, 2019 5:09 am    Post subject: Reply with quote

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
View user's profile Send private message
dinothedinamite
PostPosted: Tue Jun 25, 2019 11:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Jun 26, 2019 4:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Creating new message with data from Oracle XE
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.