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 » Need to Call a Procedure dynamically using EVAL

Post new topic  Reply to topic
 Need to Call a Procedure dynamically using EVAL « View previous topic :: View next topic » 
Author Message
edarasumanth
PostPosted: Tue Apr 03, 2007 10:05 pm    Post subject: Need to Call a Procedure dynamically using EVAL Reply with quote

Novice

Joined: 15 Jun 2006
Posts: 21

I have a requirement where i will be getting the procedure name(which should be invoked) in a input file. I need to call that procedure which is coming from input. so i need to achieve dynamic action.
Ex: set procname=InputRoot.XML.Employee.Procname;

EVAL('Call sample.' ||procname|| '(inputref,outputref)'';');

here sample is the broker schema name. under this schema my procedures have been defined.

inputref is the reference pointing to inputroot
outputref is the reference pointing to outputroot.

This is my procedure code:

--------------------
BROKER SCHEMA sample

CREATE PROCEDURE ProcessInput(IN inputRef REFERENCE,INOUT outputref REFERENCE)
BEGIN

SET outputref.XML.Student.SNO = inputRef.XML.Employee.ENO;

END;
-------------------------

This is my control flow code
-------------------------------------
PATH sample;
CREATE COMPUTE MODULE RefProc_MsgFlow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();



CREATE LASTCHILD OF OutputRoot DOMAIN 'XML' NAME 'XML';


DECLARE inputRef REFERENCE TO InputRoot;
DECLARE outputref REFERENCE TO OutputRoot;
DECLARE procname CHARACTER;
SET procname=inputRef.XML.Employee.PROCNAME;

EVAL('Call sample.' ||procname|| '(inputref,outputref)'';');

RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER;
DECLARE J INTEGER;
SET I = 1;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;

END MODULE;

--------------------------------------

MY input message


<Employee><ENO>001</ENO><PROCNAME>ProcessInput</PROCNAME></Employee>

Could you please any one suggest to dynamically calling a procedure using EVAL
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
sarat
PostPosted: Tue Apr 03, 2007 10:37 pm    Post subject: Reply with quote

Centurion

Joined: 29 Jun 2005
Posts: 136
Location: India

So wat wat the problem?

Getting any errors?


Check ur EVAL Statement!!

This may help you


Quote:
EVAL('Call sample.'||procname||'(inputref,outputref)''' ||;||'''');

_________________
With Regards,
Sarat.
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 » Need to Call a Procedure dynamically using EVAL
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.