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 » retrieving REF CURSOR from DB using ESQL

Post new topic  Reply to topic
 retrieving REF CURSOR from DB using ESQL « View previous topic :: View next topic » 
Author Message
umaneesh
PostPosted: Sun Apr 11, 2010 10:20 am    Post subject: retrieving REF CURSOR from DB using ESQL Reply with quote

Novice

Joined: 13 Apr 2009
Posts: 24

Hi,

I have a requirement to call an oracle stored procedure which has REF_CURSOR parameter included. I have to retrieve the ref_cursor [result set]to get the values back from DB. When I do this from ESQL, I am receiving Invalid parameter error back from DB.

Stored proc in oracle:

PROCEDURE ORC_SP_DATA (
SP_ID IN VARCHAR2,
IN SP_CODE IN VARCHAR2,
AHG_CUR OUT REF CURSOR);

ESQL code to call:

CREATE PROCEDURE UPDATE_RETR_SP(IN SP_ID CHARACTER, IN SP_CODE CHARACTER) LANGUAGE DATABASE DYNAMIC RESULT SETS 1 EXTERNAL NAME "QUAL.SP_ORC.ORC_SP_DATA";

Quote:
CALL UPDATE_RETR_SP(sp_Id, sp_code, Environment.ResultSet1[]);


Is this the way should I call ref_cursor parameters from ESQL? Am I doing something wrong?

pls

Thanks!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Apr 11, 2010 12:41 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

I would have thought that you'd have to put the result set into a variable of type ROW...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Sun Apr 11, 2010 2:15 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
I would have thought that you'd have to put the result set into a variable of type ROW


He did (effectively) as ROW is just another word for tree...

The syntax used here looks correct, so can you post the full text of the error please along with the versions of Broker and Oracle. Also check that you have enabled the driver option "ProcedureReturnsResults"...


Kind Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
umaneesh
PostPosted: Sun Apr 11, 2010 5:02 pm    Post subject: Reply with quote

Novice

Joined: 13 Apr 2009
Posts: 24

mgk wrote:
Quote:
I would have thought that you'd have to put the result set into a variable of type ROW


He did (effectively) as ROW is just another word for tree...


Yes. This is not working either.

mgk wrote:

The syntax used here looks correct, so can you post the full text of the error please along with the versions of Broker and Oracle.


Oracle version: 10.2.0-64
Broker version: 6.1.0.5

Error text:
Quote:
Apr 11 19:38:18 user:err|error WebSphere Broker v6105[1249416]: (BROKER.EXECGRP)[2964]BIP2321E: Database error: ODBC return code '-1'. : BROKER.3395ac57-2601-0000-0080-d742dba13ec8: /build/S610_P/src/DataFlowEngine/ImbOdbc.cpp: 333: ImbOdbcHandle::checkRcInner: :
Apr 11 19:38:18 user:err|error WebSphere Broker v6105[1249416]: (BROKER.EXECGRP)[2964]BIP2322E: Database error: SQL State 'HY000'; Native Error Code '20103'; Error Text '[IBM][ODBC Oracle Wire Protocol driver][Oracle]ORA-20103: Invalid param - SP_CODE is invalid ORA-06512: at "QUAL.SP_ORC.ORC_SP_DATA", line 149 ORA-06512:



mgk wrote:
Also check that you have enabled the driver option "ProcedureReturnsResults"...
Back to top
View user's profile Send private message
umaneesh
PostPosted: Sun Apr 11, 2010 6:16 pm    Post subject: Reply with quote

Novice

Joined: 13 Apr 2009
Posts: 24

In addition to my above response,

mgk wrote:
Also check that you have enabled the driver option "ProcedureReturnsResults"...
[/quote]

I am restricted to see the options. But will get it shortly.

I have observed one thing. When I executed the same stored proc from SQL Plus, it worked. That means, the issue is with the way I call from ESQL. Thats for sure.

Will this work by DatabaseRetrieve Node or Mapping node? I guess, when this doesnt work with esql the same way with these nodes too.

Thanks.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Sun Apr 11, 2010 10:04 pm    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

I may be missing the mark here as its been a while since i've played with result sets and broker, but..... in this instance, shouldnt you declare an extra out parameter on the procedure declaration in ESQL of type reference and then remove the dynamic result set declaration bit?
Back to top
View user's profile Send private message
umaneesh
PostPosted: Wed Apr 14, 2010 8:24 am    Post subject: Reply with quote

Novice

Joined: 13 Apr 2009
Posts: 24

nothing worked out. Infact we happened to see this in info center of v6:

Quote:
Parameters cannot be of the ESQL REFERENCE, ROW, LIST, or INTERVAL data types.


We had changed the stored procedure to have a CLOB type instead of REF_CURSOR now.

But, I dont understand how it worked here in the below thread!

http://www.mqseries.net/phpBB2/viewtopic.php?t=52871&sid=dcc33bbee34fccff8f3c1546705685b4

Thanks
Back to top
View user's profile Send private message
mgk
PostPosted: Wed Apr 14, 2010 10:00 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi, please raise a PMR for this as this does work and is supported. There must be something different in your environment which is preventing this from working in this case. The documentation you found is regarding defined parameters on the function itself, rather than DYNAMIC RESULT SETS

Kind Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
akmar2k
PostPosted: Tue May 24, 2011 8:17 am    Post subject: Resolution? Reply with quote

Novice

Joined: 01 Jun 2006
Posts: 22

Hello,

Has there been any resolution on this issue? Did you run it with IBM and got any responses?

Thanks
Back to top
View user's profile Send private message
umaneesh
PostPosted: Tue May 24, 2011 12:12 pm    Post subject: Resolution? Reply with quote

Novice

Joined: 13 Apr 2009
Posts: 24

Hi,

I remember the issue was with Oracle stored procedure. It started working fine when DB guys fixed it. But broker supports ref_cursor and we captured it like this,

CALL UPDATE_RETR_SP(sp_Id, sp_code, Environment.ResultSet1[]);

Thanks
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 » retrieving REF CURSOR from DB using ESQL
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.