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 » Procedure call returns error

Post new topic  Reply to topic
 Procedure call returns error « View previous topic :: View next topic » 
Author Message
sankritya
PostPosted: Fri Apr 24, 2015 2:43 am    Post subject: Procedure call returns error Reply with quote

Centurion

Joined: 14 Feb 2008
Posts: 100

Hello All,

Unable to understand the reason of error for the following piece of code used for calling a stored procedure
Code:
CREATE PROCEDURE GetDocumentRecipient (IN P1 CHARACTER)
  LANGUAGE DATABASE
  DYNAMIC RESULT SETS 1
EXTERNAL NAME "RP.getDocumentRecipient";

CREATE COMPUTE MODULE StoredProcedure_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      
      DECLARE LIS CHARACTER '803619' ;   
      CALL GetDocumentRecipient ( Environment.XML.Msg[], LIS ) ;
      
      RETURN TRUE;
   END;

   
END MODULE;


Oracle Procedure being called is
Code:
CREATE OR REPLACE PROCEDURE RP.getDocumentRecipient
(
p_recordset OUT SYS_REFCURSOR,
PlanId IN varchar2
) .. (further it is select * from some tables for the p_recordset)




Exception returned is

Quote:
ExceptionList
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbDataFlowNode.cpp
Line:INTEGER:1087
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:StoredProcedure#FCMComposite_1_1
Label:CHARACTER:StoredProcedure.MQ Input
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbComputeNode.cpp
Line:INTEGER:489
Function:CHARACTER:ImbComputeNode::evaluate
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:StoredProcedure#FCMComposite_1_3
Label:CHARACTER:StoredProcedure.Compute
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbRdl/ImbRdlStatementGroup.cpp
Line:INTEGER:643
Function:CHARACTER:SqlStatementGroup::execute
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:StoredProcedure#FCMComposite_1_3
Label:CHARACTER:StoredProcedure.Compute
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2488
Text:CHARACTER:Error detected, rethrowing
Insert
Type:INTEGER:5
Text:CHARACTER:.StoredProcedure_Compute.Main
Insert
Type:INTEGER:5
Text:CHARACTER:12.3
Insert
Type:INTEGER:5
Text:CHARACTER:GetDocumentRecipient(Environment.XML.Msg[ ], LIS);
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbRdl/ImbRdlRoutine.cpp
Line:INTEGER:1345
Function:CHARACTER:SqlRoutine::setupChildEnv
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:StoredProcedure#FCMComposite_1_3
Label:CHARACTER:StoredProcedure.Compute
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2931
Text:CHARACTER:
Insert
Type:INTEGER:5
Text:CHARACTER:RESULT_SET_PARAM_0


Clearly I have not used this value RESULT_SET_PARAM any where in my code.

Checked the oracle driver also -- it is set to ProcedureRetResults = 1.
Procedure call is done as told in WMB documentation.

WMB Version - 7.0.0.4
Oracle - 11g
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Apr 24, 2015 3:12 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.

Environment.XML.Msg[]

is what exactly?

Is it a CHAR?
Is it a Plane?
Is it Superman?


I hope that this is a very old flow that you are changing. If not care to explain why you are using Environment.XML.??????
_________________
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
sankritya
PostPosted: Sat Apr 25, 2015 7:29 am    Post subject: Reply with quote

Centurion

Joined: 14 Feb 2008
Posts: 100

It is just used for saving the response message which I plan to use later while preparing the response. Response is from refcurser so used []. It is not old flow so can use anything if it works. Use of XML is just for naming. I can change it to Environment.Msg[] also.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sat Apr 25, 2015 9:00 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.

This post has a reply by MGK that you might like to read and change your code to follow the guideline suggested.
http://www.mqseries.net/phpBB2/viewtopic.php?t=69006&view=next&sid=fe117ba9a3daee3860db38502b020149
_________________
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
nelson
PostPosted: Sat Apr 25, 2015 10:41 am    Post subject: Reply with quote

Partisan

Joined: 02 Oct 2012
Posts: 313

How have you defined the PROCEDURE in broker?

Try something like this:

Code:
CREATE PROCEDURE GetDocumentRecipient (
   IN PlanId CHAR
)
LANGUAGE DATABASE
DYNAMIC RESULT SETS 1
EXTERNAL NAME "yourschema.yourproc";


and call it this way:

Code:
DECLARE dbData ROW;
DECLARE PlanId CHARACTER '1213213212132';
CALL GetDocumentRecipient(PlanId,dbData.myRow[]);   


Hope that helps...
Back to top
View user's profile Send private message
sankritya
PostPosted: Mon Apr 27, 2015 6:11 am    Post subject: Reply with quote

Centurion

Joined: 14 Feb 2008
Posts: 100

Code changed .. exception changed.
Code:

CREATE PROCEDURE GetDocument (IN PlanId CHARACTER)
  LANGUAGE DATABASE
  DYNAMIC RESULT SETS 1

EXTERNAL NAME "RP.getDocument";


CREATE COMPUTE MODULE StoredProcedure_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      
      DECLARE LISTItem ROW ;
   
      DECLARE LIS CHARACTER '803619' ;

      CALL GetDocument (  '803619', LISTItem.Msg[] ) ;
      
      RETURN TRUE;
   END;
   
END MODULE;


And the exception
Quote:
ExceptionList
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbDataFlowNode.cpp
Line:INTEGER:1087
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:StoredProcedure#FCMComposite_1_1
Label:CHARACTER:StoredProcedure.MQ Input
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbComputeNode.cpp
Line:INTEGER:489
Function:CHARACTER:ImbComputeNode::evaluate
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:StoredProcedure#FCMComposite_1_3
Label:CHARACTER:StoredProcedure.Compute
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbRdl/ImbRdlStatementGroup.cpp
Line:INTEGER:643
Function:CHARACTER:SqlStatementGroup::execute
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:StoredProcedure#FCMComposite_1_3
Label:CHARACTER:StoredProcedure.Compute
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2488
Text:CHARACTER:Error detected, rethrowing
Insert
Type:INTEGER:5
Text:CHARACTER:.StoredProcedure_Compute.Main
Insert
Type:INTEGER:5
Text:CHARACTER:8.3
Insert
Type:INTEGER:5
Text:CHARACTER:GetDocument('803619', LISTItem.Msg[ ]);
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbRdl/ImbRdlRoutine.cpp
Line:INTEGER:767
Function:CHARACTER:SqlRoutine::invoke
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:StoredProcedure#FCMComposite_1_3
Label:CHARACTER:StoredProcedure.Compute
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2934
Text:CHARACTER:Error occured in procedure
Insert
Type:INTEGER:5
Text:CHARACTER:GetDocument
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbDatabaseManager.cpp
Line:INTEGER:2670
Function:CHARACTER:ImbDatabaseManager::getDBProcedureParameterInformation
Type:CHARACTER:ComIbmDatabaseConnectionManager
Name:CHARACTER:ComIbmDatabaseConnectionManager
Label:CHARACTER:ComIbmDatabaseConnectionManager
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2921
Text:CHARACTER:The procedure '&1' with '&2' parameters could not be match with a corresponding Database stored porocedure.
Insert
Type:INTEGER:5
Text:CHARACTER:SFG.RP.GETDOCUMENT
Insert
Type:INTEGER:2
Text:CHARACTER:1


And DB Procedure
Quote:
CREATE OR REPLACE PROCEDURE RP.getDocument
(
PlanId IN varchar2,
p_recordset OUT SYS_REFCURSOR
)


IS
BEGIN
OPEN p_recordset FOR
select rownum, X.* from
(
SELECT distinct
****

) XYZ;


Exception
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('NO_DATA_FOUND Error : '||sqlerrm);
RAISE;

WHEN OTHERS THEN
dbms_output.put_line('OTHERS Error : '||sqlerrm);
RAISE;
END;
/


I gues it is just one setting which is missed somewhere but do not know where
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Apr 27, 2015 11:50 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.

Does the user defined in the ODBC connection have all the right access privs for the Stored Proc?
Have you tried accessing the DB using SQLDeveloper and the usename used in the ODBC connection and trying to call the SP?
If so does it work?
_________________
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
sankritya
PostPosted: Mon May 11, 2015 2:35 am    Post subject: Reply with quote

Centurion

Joined: 14 Feb 2008
Posts: 100

Thanks it was permission issue. WMB user did not had access over the database table. Strange though it was not returning any permission issue in exception tree.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 11, 2015 4:37 am    Post subject: Reply with quote

Grand High Poobah

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

sankritya wrote:
Thanks it was permission issue. WMB user did not had access over the database table. Strange though it was not returning any permission issue in exception tree.

Maybe because of the exception handling in your sql procedure ...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Mon May 11, 2015 4:40 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
sankritya wrote:
Thanks it was permission issue. WMB user did not had access over the database table. Strange though it was not returning any permission issue in exception tree.

Maybe because of the exception handling in your sql procedure ...


maybe because the user didn't have access to the stored procedure and so WMB couldn't see it.
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 » Procedure call returns error
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.