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 » Help Calling Oracle stored procedure ref cursor in esql

Post new topic  Reply to topic Goto page 1, 2  Next
 Help Calling Oracle stored procedure ref cursor in esql « View previous topic :: View next topic » 
Author Message
karthusb
PostPosted: Thu Jun 27, 2013 1:02 pm    Post subject: Help Calling Oracle stored procedure ref cursor in esql Reply with quote

Novice

Joined: 26 Jun 2013
Posts: 12

Hello All ,

I am trying to call oracle stored procedure which has reference cursor, I tried muliple way but getting following error

The procedure '&1' with '&2' parameters could not be match with a corresponding Database stored porocedure.

Any one has answere please help .

below is the procedure and call from esql

CREATE PROCEDURE GET_SITE_INFO(IN P_EV_IDN INTEGER ,IN P_OLD_METER_NUMBER CHAR )
LANGUAGE DATABASE
DYNAMIC RESULT SETS 3
EXTERNAL NAME "csb.csbkd400.GET_SITE_INFO";

CALL GET_SITE_INFO(P_EV_IDN, P_OLD_METER_NUMBER,Environment.Variable.P_SITE_INFO[],Environment.Variable.P_OLD_METER_NUMBER ,Environment.Variable.P_SUCCESS_FLAG);
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jun 27, 2013 9:05 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Welcome to this forum.

You are certainly diving in at the deep end.

However this topic has been discussed many times before here. Please take some time and use the google search (top right of the page) and look at those other posts.
IF your problem is not covered by them please come back here and add a reply to this thread saying something like

I looked at these threads
<insert list>

and none of the solutions apply.

Then we can move on to help you knowing that all the common solutions have been covered.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
karthusb
PostPosted: Tue Jul 02, 2013 9:45 am    Post subject: Still no Success Reply with quote

Novice

Joined: 26 Jun 2013
Posts: 12

Hello Thanks for your response ,

Passthrough statement works but returns only one result set .

SET Environment.Variable.output[] = PASSTHRU('{CALL csb.csbkd400.get_site_info(?,?,?,?,?)}' values (P_EV_IDN, P_OLD_METER_NUMBER,P_SITE_INFO,P_OLD_METER_NUMBER ,P_SUCCESS_FLAG));

Changed DNS advaced setting 1) Enable SQLDescribeParams and Procedure Returns Reslults but no luck

3 out parameters from my query has to return 3 resut sets this is not happening via PASSTHRU. I dont know what datatype to pass to get the cursor results from Database .

Error with regular query .
The procedure '&1' with '&2' parameters could not be match with a corresponding Database stored porocedure.

Anyone has answere please reply
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 02, 2013 11:21 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

So did you look at previous answers to this question?
Did you configure the Oracle ODBC Connection correctly?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
karthusb
PostPosted: Tue Jul 02, 2013 11:50 am    Post subject: Reply with quote

Novice

Joined: 26 Jun 2013
Posts: 12

Previous answeres doesn't clearly have any resolution steps ..-(

Anyway , If the Connections are wrong I should not get PASSTHRU statement work .
Its not connection problem Its calling statement that's causing problem when referring to the reference cursor in stored proc .

If you suggest me to try differently please help.
Back to top
View user's profile Send private message
kash3338
PostPosted: Tue Jul 02, 2013 5:55 pm    Post subject: Re: Help Calling Oracle stored procedure ref cursor in esql Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

karthusb wrote:

Code:

CREATE PROCEDURE GET_SITE_INFO(IN P_EV_IDN INTEGER ,IN P_OLD_METER_NUMBER CHAR )   
                LANGUAGE DATABASE 
   DYNAMIC RESULT SETS 3
   EXTERNAL NAME "csb.csbkd400.GET_SITE_INFO";

CALL GET_SITE_INFO(P_EV_IDN, P_OLD_METER_NUMBER,Environment.Variable.P_SITE_INFO[],Environment.Variable.P_OLD_METER_NUMBER ,Environment.Variable.P_SUCCESS_FLAG);



What is the datatype of "P_EV_IDN" and "P_OLD_METER_NUMBER" in your Stored Procedure? You have defined 3 dynamic result sets, but you just have one Environment variable declared as vector value, it should be 3.

What is the purpose of these two variables in your CALL statement, Environment.Variable.P_OLD_METER_NUMBER ,Environment.Variable.P_SUCCESS_FLAG?
Back to top
View user's profile Send private message Send e-mail
karthusb
PostPosted: Wed Jul 03, 2013 5:27 am    Post subject: Reply with quote

Novice

Joined: 26 Jun 2013
Posts: 12

P_EV_IDN = NUMBER(9,0) in SP
p_OLD_METER_NUMBER = VARCHAR2(25 bytes) in SP
Out of 3 dynamic results only one returns list which is the cursor referense in SP .
other 2 returns character values.

P_EV_IDN ,p_OLD_METER_NUMBER are the IN Parameters to the SP which returns 3 dynamic results in 3 Out parameters.

Thanks for the support..
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jul 03, 2013 6:00 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

karthusb wrote:
Out of 3 dynamic results only one returns list which is the cursor referense in SP .
other 2 returns character values.


This is what the Infocenter says here

Quote:
If the called routine has any DYNAMIC RESULT SETS specified in its definition, the number of expressions in the CALL statement's ParameterList must match the number of parameters to the routine, plus the number of DYNAMIC RESULT SETS. For example, if the routine has three parameters and two DYNAMIC RESULT SETS, the CALL statement must pass five parameters to the called routine. The parameters passed for the two DYNAMIC RESULT SETS must be list parameters; that is, they must be field references qualified with array brackets [ ]; for example, Environment.ResultSet1[].
Back to top
View user's profile Send private message Send e-mail
karthusb
PostPosted: Wed Jul 03, 2013 8:07 am    Post subject: Reply with quote

Novice

Joined: 26 Jun 2013
Posts: 12

I tried all the combinations before posting .. but no luck ..


CREATE PROCEDURE GET_SITE_INFO(IN P_EV_IDN INTEGER ,IN P_OLD_METER_NUMBER CHARACTER , OUT P_SITE_INFO CHARACTER , OUT P_SUCCESS_FLAG CHARACTER , OUT P_ERROR_MESSAGE CHARACTER)
LANGUAGE DATABASE
--DYNAMIC RESULT SETS 3
EXTERNAL NAME "csb.csbkd400.GET_SITE_INFO";

DECLARE cursor REFERENCE TO Environment.Variable.output;
CALL GET_SITE_INFO(P_EV_IDN, P_OLD_METER_NUMBER,cursor.P_SITE_INFO[],cursor.P_ERROR_MESSAGE[],cursor.P_SUCCESS_FLAG[]);

Big Question is what datatype should be declared to P_SITE_INFO as it will return list ?

And as per the error
The procedure '&1' with '&2' parameters could not be match with a corresponding Database stored porocedure

first '&1' with '&2' parameters are not able to parse before resulting.
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jul 03, 2013 9:11 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

karthusb wrote:
P_EV_IDN = NUMBER(9,0) in SP


Here is your problem. Refer this link and you will get the problem.

Oracle NUMBER(P,S) should be DECIMAL in ESQL and not INTEGER.
Back to top
View user's profile Send private message Send e-mail
karthusb
PostPosted: Wed Jul 03, 2013 9:38 am    Post subject: Reply with quote

Novice

Joined: 26 Jun 2013
Posts: 12

Thank you for your suggestion ,
I even tried that earlier but no luck . But upon your suggestion I gave a shot once again but same error prevails.
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jul 03, 2013 9:45 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

karthusb wrote:
Thank you for your suggestion ,
I even tried that earlier but no luck . But upon your suggestion I gave a shot once again but same error prevails.


Can you please share the ESQL DATABASE PROCEDURE along with the CALL statements and the variable declarations using [c o d e] tags?

Also, did you try with FLOAT datatype?
Back to top
View user's profile Send private message Send e-mail
karthusb
PostPosted: Wed Jul 03, 2013 9:57 am    Post subject: Reply with quote

Novice

Joined: 26 Jun 2013
Posts: 12

Yes I did try with float , decimal Datatype earlier ..
I definetly think there is no issue with SP as its working good with PASSTHRU statement .


PROCEDURE get_site_info
(
p_ev_idn IN events.EV_IDN%type,
p_old_meter_number IN installed_registers.insr_meter_number%type,
p_tms_code IN installed_registers.insr_tms_code%type,
p_site_info OUT site_cur,
p_success_flag OUT varchar2, -- Y - Success, N - Fail
p_error_message OUT varchar2
);

end CSBKD400;

events.EV_IDN%type and installed_registers.insr_meter_number%type details refers from different table

as EV_IDN ( NUMBER 9,0) , insr_meter_number ( VARCHAR2 ,25)



ESQL : Not Working
==============


DECLARE cursor REFERENCE TO Environment.Variable.output;
DECLARE P_SITE_INFO CHARACTER;
DECLARE P_SUCCESS_FLAG CHARACTER;
DECLARE P_ERROR_MESSAGE CHARACTER;
DECLARE P_EV_IDN REFERENCE TO InputRoot.XMLNSC.*:Envelope.*:Body.ms:MeterCompletionRequest.ms:EventId;
SET P_EV_IDN = CAST(P_EV_IDN AS DECIMAL);
DECLARE P_OLD_METER_NUMBER REFERENCE TO InputRoot.XMLNSC.*:Envelope.*:Body.ms:MeterCompletionRequest.ms:OutMeterNumber;
-- SET P_OLD_METER_NUMBER = CAST(P_OLD_METER_NUMBER AS DECIMAL);
-- DECLARE P_TMS_CODE CHAR;


CALL GET_SITE_INFO(P_EV_IDN, P_OLD_METER_NUMBER,cursor.P_SITE_INFO[],cursor.P_ERROR_MESSAGE[],cursor.P_SUCCESS_FLAG[]);
SET OutputRoot.XMLNSC.DBResponse.Reply.ReplyCode[] = Environment.Variable.output.P_SUCCESS_FLAG[];
SET OutputRoot.XMLNSC.DBResponse.Reply.siteinfo[] = Environment.Variable.output.P_SITE_INFO[];
SET OutputRoot.XMLNSC.DBResponse.Reply.errorMessage[] = Environment.Variable.output.P_ERROR_MESSAGE[];
RETURN TRUE;
END;
CREATE PROCEDURE GET_SITE_INFO(IN P_EV_IDNN DECIMAL ,IN P_OLD_METER_NUMBER CHARACTER , OUT P_SITE_INFO CHARACTER , OUT P_SUCCESS_FLAG CHARACTER , OUT P_ERROR_MESSAGE CHARACTER)
LANGUAGE DATABASE
--DYNAMIC RESULT SETS 3
EXTERNAL NAME "csb.csbkd400.GET_SITE_INFO";


ESQL : Working

problem is returning only one result set. good part is its returning cursor details

SET Environment.Variable.output[] = PASSTHRU('{CALL csb.csbkd400.get_site_info(?,?,?,?,?)}' values (P_EV_IDN, P_OLD_METER_NUMBER,P_SITE_INFO,P_OLD_METER_NUMBER ,P_SUCCESS_FLAG));
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Wed Jul 03, 2013 11:21 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

try

Code:
CREATE PROCEDURE GET_SITE_INFO(IN P_EV_IDNN DECIMAL ,IN P_OLD_METER_NUMBER CHARACTER )
LANGUAGE DATABASE
DYNAMIC RESULT SETS 3
EXTERNAL NAME "csb.csbkd400.GET_SITE_INFO";


That's two things you are passing in plus three RESULT SETS. Which matches your call statement.
Back to top
View user's profile Send private message AIM Address
karthusb
PostPosted: Wed Jul 03, 2013 11:31 am    Post subject: Reply with quote

Novice

Joined: 26 Jun 2013
Posts: 12

thats the first piece of code i posted when asking for help. It did not work
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Help Calling Oracle stored procedure ref cursor in 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.