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 » passing string(more than 2k) to stored procedure on oracle

Post new topic  Reply to topic
 passing string(more than 2k) to stored procedure on oracle « View previous topic :: View next topic » 
Author Message
vickas
PostPosted: Tue Feb 28, 2017 3:20 am    Post subject: passing string(more than 2k) to stored procedure on oracle Reply with quote

Centurion

Joined: 18 Aug 2013
Posts: 126

Hie guys ..

I get the below exceptions when passing a string more than 2000 characters to the stored procedure from the flow .

so Child SQL exception 22001 [unixODBC][IBM][ODBC Oracle Wire Protocol driver]String data, right truncated. Error in parameter 1

so Child SQL exception 32 [unixODBC][IBM][ODBC 20101 driver]1816073


the below is the simple DB procedure on oracle which is defined as below
which takes the input string and returns the same
Code:
create or replace
PROCEDURE Test(inpstr IN CLOB, outstr OUT CLOB, error_message OUT CHARACTER)
IS
BEGIN
 outstr := inpstr ;
 
 DBMS_OUTPUT.PUT_LINE(outstr);
   
EXCEPTION
  WHEN OTHERS THEN
    error_message := SQLERRM;
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;


I get the above mentioned exception ONLY when the input string("Input") is more than 2000 characters.
here is the esql code
Code:

CALL Fetchtest(Input,Output,error_message)

CREATE PROCEDURE Fetchtest(IN inpstr CHARACTER,  OUT outstr CHARACTER ,OUT error_message CHARACTER)
LANGUAGE DATABASE
EXTERNAL NAME "TEST";


ODBCINI configuration
Code:
;# Oracle stanza
[TEST]
Driver=/opt/ibm/mqsi/9.0.0.1/ODBC/V7.0/lib/UKora26.so
Description=DataDirect 7.0 ODBC Oracle Wire Protocol
HostName=10.10.10.10
PortNumber=1521
ServiceName=DBSN
CatalogOptions=0
EnableStaticCursorsForLongData=0
ApplicationUsingThreads=1
EnableDescribeParam=1
OptimizePrepare=1
WorkArounds=536870912
ProcedureRetResults=1
ColumnSizeAsCharacter=1
LoginTimeout=0


here is the environment
Quote:
IIB version - 9.0.0.2
MQ version - 7.5
OS - RHEL 6.5


is there any setting to be done on odbc ini file ?
is it a limitation in IIB ?
pls help me , how can we pass more than 2k chars length to procedure ?
[/b]
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 28, 2017 5:45 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

You're cheating slightly - the stored procedure isn't using strings, the parameters are CLOB which the DataDirect drivers don't support.

Change the stored procedure to use VARCHAR and it will work to the maximum size of a VARCHAR in Oracle.

If you need to pass a string longer than that through a stored procedure, change your design and/or use a different ETL tool than IIB.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
adubya
PostPosted: Tue Feb 28, 2017 6:15 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

Are CLOBs not supported ?

The IIB documentation lists CLOB as a supported type for ESQL accessing databases.

https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak05730_.htm

And I'm pretty sure I've worked on systems where we were insterting CLOB data into an Oracle DB using ESQL + Datadirect driver.

Or is the CLOB restriction for stored procedure invocations only ?
_________________
Independent Middleware Consultant
andy@knownentity.com
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Feb 28, 2017 6:30 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

I'm fairly sure that you can't map a character to a CLOB in a stored procedure, and if you use a CLOB in a ESQL DB statement it maps to a BLOB not a CHARACTER.

Having said that, I was fairly sure going drinking with @mqjeff wouldn't result in getting so drunk I'd have to show the cab driver my hotel key so he knew where to take me and I was seriously mistaken about that.

For the record (and before my most worthy associate says anything) I did not fall over drunk on the sidewalk. That tree pulled out in front of me without warning and I collided with the bench trying to avoid it, losing my footing in the process.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Feb 28, 2017 6:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447


_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
adubya
PostPosted: Tue Feb 28, 2017 6:33 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

I can't vouch for drinking sessions with mqjeff

But the mapping table I linked to shows CLOBs are implicitly cast to ESQL CHAR types when referenced in ESQL calls.
_________________
Independent Middleware Consultant
andy@knownentity.com
Back to top
View user's profile Send private message Send e-mail
vickas
PostPosted: Tue Feb 28, 2017 8:38 pm    Post subject: Reply with quote

Centurion

Joined: 18 Aug 2013
Posts: 126

Vitor wrote:
You're cheating slightly - the stored procedure isn't using strings, the parameters are CLOB which the DataDirect drivers don't support.
.


I have changed the input parameters of the DB stored procedure to VARCHAR and passed input as character from ESQL

I also tried the other way around of passing Blob from ESQL to the DB stored procedure while changing the input parameters to CLOB

in both the cases , i get the same exception .
can you please throw some light
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Mar 01, 2017 5:00 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The error is saying that the data you're sending in is too long for the field in use.

"String data, right truncated. Error in parameter 1" means "the string you sent in as parameter 1 was truncated from the right'.

It's possible that the db is expecting a ccsid that uses only single byte characters and you are sending in multibyte characters, so while the string looks like the right size, the db is counting the length wrong.

Regardless, take a user and odbc trace. Then ask the db admins to look at what they are seeing on their side - and make sure that your definition matches the stored procedure you're calling...
_________________
chmod -R ugo-wx /
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 » WebSphere Message Broker (ACE) Support » passing string(more than 2k) to stored procedure on oracle
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.