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 » WebSphere Message Broker (ACE) Support » Updating Oracle databse using MQSI with BLOB input

Post new topic  Reply to topic
 Updating Oracle databse using MQSI with BLOB input « View previous topic :: View next topic » 
Author Message
kwelch
PostPosted: Fri Jan 11, 2002 1:55 pm    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

I was finally able to get my id/password problems resolved and now find myself unable to update the ORACLE databse unless I hard code literal values.
I am using BLOB input and I am getting an error saying that a literal string is too long for a column. Sounds easy right? It doesn't tell me what column though. I have tried eliminating column for column and it doesn't seem to like any of them, which leads me to believe it's an issue with the BLOB data. The part that bothers me though is this same message flow will update a DB2(UDB) table on an NT box. I should tell you that the ORACLE database lives on a UNIX box and my MQSI process is on NT and I am using v2.0.1 of MQSI.
Does anyone have any ideas or thoughts on this? Thanks for any ideas or suggestions in advance.

Karen
Back to top
View user's profile Send private message Send e-mail
ravi
PostPosted: Fri Jan 11, 2002 2:41 pm    Post subject: Reply with quote

Novice

Joined: 07 Nov 2001
Posts: 16

Hi,
i came across the similar problem while trying to insert into sybase database while it was working for DB2. It got fixed when i applied CSD1 to MQSI2.0.2. but i have never seen this documented by IBM.
i guess its the problem with the ODBC calls to the drivers other than DB2.

it works fine with the WMQI2.1.

ravi.
Back to top
View user's profile Send private message
kwelch
PostPosted: Fri Jan 11, 2002 2:49 pm    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

Hi Ravi,

So it could be the ODBC drivers are not correct? I have been told that for ORACLE we need to use the MERANT ORACLE ODBC Drivers. We did not have those installed so they just used the Oracle ODBC Drivers. Someone else said that the MERANT ones were only if MQSI were on UNIX? Can anyone confirm this? Thanks again for your help!

Karen
Back to top
View user's profile Send private message Send e-mail
ravi
PostPosted: Fri Jan 11, 2002 2:58 pm    Post subject: Reply with quote

Novice

Joined: 07 Nov 2001
Posts: 16

IBM insists you to use the merant driver where ever is your MQSI(window or unix).

ravi.
Back to top
View user's profile Send private message
kwelch
PostPosted: Fri Jan 11, 2002 3:01 pm    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

Ravi,

But in your case you still had issues even with the MERANT Drivers?
Could you point me to the documentation where it says that we need to use the MERANT drivers so I can show my MQSI techies?

Thanks so much for your help!!!! It is greatly appreciated!

Karen
Back to top
View user's profile Send private message Send e-mail
ravi
PostPosted: Fri Jan 11, 2002 3:10 pm    Post subject: Reply with quote

Novice

Joined: 07 Nov 2001
Posts: 16

yes, i had issues even while i was using Merant driver for sybase.

About the drivers, i guess it is mentoined several places.
look in the Administration guide.

chapter2.How to configure your MQSeries --> Defining and Athourising Database Resources --> Database setup and configuration

ravi.
Back to top
View user's profile Send private message
ravi
PostPosted: Fri Jan 11, 2002 3:13 pm    Post subject: Reply with quote

Novice

Joined: 07 Nov 2001
Posts: 16

sorry, it was chapter 2.How to configure your MQSeries Integrator network

hope you found it.

ravi.
Back to top
View user's profile Send private message
kwelch
PostPosted: Fri Jan 11, 2002 3:27 pm    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

Ravi,

No problem. I did find it but in my documentation for Windows NT it just says to select the appropriate driver for your datasource. For the Solaris and AIX it specifically says use the Merant ones. This is probably why my techies think it only pertains to the UNIX.
Thanks again.

Karen
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Fri Jan 11, 2002 3:27 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Karen,

Can you post your ESQL code that you are using to insert into ORACLE database. What version of ORACLE dataabse are you using?


Kiran
Back to top
View user's profile Send private message Visit poster's website
kwelch
PostPosted: Fri Jan 11, 2002 3:38 pm    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

Kiran,

Here is the ESQL:

DECLARE PGMNAME BLOB;
SET PGMNAME = SUBSTRING(Body.BLOB FROM 1 FOR 53); /* WILL HOLD PROGNAME */

DECLARE QUEUE BLOB;
SET QUEUE = SUBSTRING(Body.BLOB FROM 54 FOR 4; /* WILL HOLD QUEUE */

DECLARE QMGR BLOB;
SET QMGR = SUBSTRING(Body.BLOB FROM 102 FOR 4; /* WILL HOLD QMGR */
DECLARE MSGLNGTH INTEGER;
SET MSGLNGTH = LENGTH(Body.BLOB);

DECLARE ORIGLNGTH INTEGER;
SET ORIGLNGTH = MSGLNGTH - 250; /*THE FIXED AMOUNT OF HIG FIELDS ADDED TO ORIG MSG */


DECLARE REST BLOB;
SET REST = SUBSTRING(Body.BLOB FROM 251 FOR ORIGLNGTH);

INSERT
INTO Database.T040.THO_BSE_MQLOGMSG(HIG_PGM_NM, HIG_APPL_QUE_NM, HIG_APPL_QMGR_NM, MQS_ORIG_MESSAGE)
VALUES (PGMNAME, QUEUE, QMGR, REST);

I have verified that the columns are all the correct length, except for the REST field which is the original message being logged. It is defined as LONG which I am told can be up to 2 gig. The others are 53, 48, 48 respectively.

Karen

Back to top
View user's profile Send private message Send e-mail
kwelch
PostPosted: Fri Jan 11, 2002 3:53 pm    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

Kiran,

Sorry I forgot to answer your Oracle version question. I think we are using Oracle 8.1.7?I can verify for sure on Monday.

Karen
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Fri Jan 11, 2002 4:07 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Karen,

You need to consider following points when dealing with ORACLE in MQSIV2. These points are from readme.txt file of MQSI V2.0.1.

1. Using Oracle 7.3.4 Enterprise Edition For Windows NT
-------------------------------------------------------
Where Oracle 7.3.4 is to be used with MQSI V2.0.1 for Windows NT, users need to ensure they are using an Oracle 8 Client Version to access their Oracle 7 Server. Oracle 8 Clients provide the correct level of ODBC support required by MQSI V2.0.1 for Windows NT.


2. Inserting Data into BLOB Columns in Oracle DB
------------------------------------------------
The Oracle drivers do not directly support inserting MQSIv2 BLOBs into Oracle BLOB columns. The workaround here is to use ESQL like this:

DECLARE B BLOB;
...
PASSTHRU('INSERT INTO Database.table1 (blob_field) VALUES( ? )',
SUBSTRING(CAST(B AS CHAR) FROM 3 FOR (LENGTH(B)-3));

This will pass a correctly formatted character string representing the BLOB to Oracle via the driver, removing the leading X' and trailing ' from the character string.


Try converting your ESQL into something like this,

PASSTHRU(
'INSERT INTO T040.THO_BSE_MQLOGMSG(HIG_PGM_NM, HIG_APPL_QUE_NM, HIG_APPL_QMGR_NM, MQS_ORIG_MESSAGE) VALUES (?,?,?)',
SUBSTRING(CAST(PGMNAME AS CHAR) FROM 3 FOR (LENGTH(PGMNAME)-3)),
SUBSTRING(CAST(QUEUE AS CHAR) FROM 3 FOR (LENGTH(QUEUE)-3)),
SUBSTRING(CAST(REST AS CHAR) FROM 3 FOR (LENGTH(REST)-3)));


Good luck!

Kiran
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Updating Oracle databse using MQSI with BLOB input
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.