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 » Not able to call stored procedure from DB using UDP

Post new topic  Reply to topic
 Not able to call stored procedure from DB using UDP « View previous topic :: View next topic » 
Author Message
chetu777
PostPosted: Tue Jan 03, 2012 8:51 pm    Post subject: Not able to call stored procedure from DB using UDP Reply with quote

Acolyte

Joined: 07 Sep 2009
Posts: 59

Hi All,

I am trying to call stored procedure and I was successfull calling it, but when I tried using UDP for the same I was not able to.

I am using the DB schema name and tablename as UDP variables. But when I assign the UDP values to an environment variable to verify whether I am getting the values, yes I am able to see the UDP value assigned to the environment variable.

When I call the stored procedure, it is taking the UDP variable name itself as the value and not the value of the variable.



--UDP variables for connecting to DB
DECLARE DBSCHEMA EXTERNAL CHARACTER 'SYSPROC';
DECLARE DBTABLENAME EXTERNAL CHARACTER 'DB2S';

CREATE COMPUTE MODULE MessageIntegration_StoreProcDB_MsgFlow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE result BOOLEAN;
CALL Min_MaxPrice()INTO result;
IF ( result = TRUE) then
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;

CREATE PROCEDURE Min_MaxPrice() RETURNS BOOLEAN
BEGIN

DECLARE SQLState1 CHARACTER;
DECLARE SQLErrorText1 CHARACTER;
DECLARE SQLCode1 INTEGER;
DECLARE SQLNativeError1 INTEGER;

DECLARE IN_PARM_ITMS CHARACTER InputRoot.XML.Item.Dir_Item_I;
DECLARE OUT_PARM_RET_CODE INTEGER;
DECLARE OUT_PARM_ITM_DETS CHARACTER;

--Calling the stored procedure from DB using UDP which is not working.
CALL TCI(IN_PARM_ITMS,OUT_PARM_RET_CODE,OUT_PARM_ITM_DETS) IN Database.DBTABLENAME.DBSCHEMA;

--The below call is working fine
--CALL TCI(IN_PARM_ITMS,OUT_PARM_RET_CODE,OUT_PARM_ITM_DETS) IN Database.DB2S.DBSchema;

SET SQLState1 = SQLSTATE;
SET SQLCode1 = SQLCODE;
SET SQLErrorText1 = SQLERRORTEXT;
SET SQLNativeError1 = SQLNATIVEERROR;
IF(SQLCode1 <> 0) THEN
THROW USER EXCEPTION MESSAGE 2950 VALUES( 'DB exception SQL State' , SQLState1 , SQLCode1 , SQLNativeError1 , SQLErrorText1 );
END IF;

SET OutputRoot.XML.Item.DIR_ITEM_I = OUT_PARM_RET_CODE;
SET OutputRoot.XML.Item.Min_Reg_Retl = OUT_PARM_ITM_DETS;
RETURN TRUE;
END;

CREATE PROCEDURE TCI(IN IN_PARM_ITMS CHAR, OUT OUT_PARM_RET_CODE INTEGER, OUT OUT_PARM_ITM_DETS CHAR) LANGUAGE DATABASE EXTERNAL NAME "TCI";

END MODULE;



Can you help me regarding this. Thanks in advance.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jan 03, 2012 9:00 pm    Post subject: Reply with quote

Grand High Poobah

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

Did you try
Code:
CALL TCI(IN_PARM_ITMS,OUT_PARM_RET_CODE,OUT_PARM_ITM_DETS) IN Database.{DBTABLENAME}.{DBSCHEMA};

Note the added curly braces...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
chetu777
PostPosted: Tue Jan 03, 2012 10:39 pm    Post subject: Reply with quote

Acolyte

Joined: 07 Sep 2009
Posts: 59

Thanks for the immediate response. Its working after I made changes as u suggested.
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 » Not able to call stored procedure from DB using UDP
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.