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 » Dynamic ESQL and Dynamic Function Calling.

Post new topic  Reply to topic Goto page Previous  1, 2
 Dynamic ESQL and Dynamic Function Calling. « View previous topic :: View next topic » 
Author Message
shrek
PostPosted: Thu Mar 02, 2006 2:48 am    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2005
Posts: 61
Location: Gudivada,India

I would just like to add that....

when something is changed in the common function/procedure, you need to rebuild your bar files and redeploy them. Same would be the case with your subflows.

Thanks.
Back to top
View user's profile Send private message
moogoo
PostPosted: Thu Mar 02, 2006 7:03 am    Post subject: Reply with quote

Acolyte

Joined: 20 Sep 2002
Posts: 54
Location: US

Great...thanks! Just a quick followup, does the reference need to be defined as INOUT or just IN? I think I read somewhere in another thread that since I would just be manipulating the data in the Environment tree as opposed to the reference itself, it could simply be defined as IN. Any truth to that?

MG
Back to top
View user's profile Send private message
mgk
PostPosted: Thu Mar 02, 2006 7:06 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

I answered this question in detail in another post, which you could find if you searched this forum. However the short answer is yes, IN will do.
_________________
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
moogoo
PostPosted: Thu Mar 02, 2006 7:55 am    Post subject: Reply with quote

Acolyte

Joined: 20 Sep 2002
Posts: 54
Location: US

Ok. Thanks again!

MG
Back to top
View user's profile Send private message
moogoo
PostPosted: Tue Mar 14, 2006 7:24 am    Post subject: Reply with quote

Acolyte

Joined: 20 Sep 2002
Posts: 54
Location: US

Does anyone know if this works in V2.1 with CSD08? I'm trying to pass a reference to the Environment tree into a function call where some elements will be created. Something like:

Declare EnvironmentRef REFERENCE TO Environment;

SET result = F1(EnvironmentRef);

where the function definition looks like:

create function F1 (Environment REFERENCE) returns CHAR
BEGIN
SET Environment.Result = 'BLAH';

RETURN Environment.Result;
END;

But, according to the trace log, its bombing out with the following:

(0x1000000)RecoverableException = (
(0x3000000)File = '/build/S210_P/src/DataFlowEngine/ImbRdl/ImbRdlAssignment.cpp'
(0x3000000)Line = 118
(0x3000000)Function = 'SqlAssignment::execute'
(0x3000000)Type = 'ComIbmComputeNode'
(0x3000000)Name = 'b79030ee-ed00-0000-0080-cd362feea21e'
(0x3000000)Label = '<FLOWNAME>
(0x3000000)Text = 'inappropriate field reference'
(0x3000000)Catalog = 'WMQIv210'
(0x3000000)Severity = 3
(0x3000000)Number = 2536
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '8082'
)
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '4'
)
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = 'SET'
)
)
)
)
)
Back to top
View user's profile Send private message
Gralgrathor
PostPosted: Fri Oct 17, 2014 3:55 am    Post subject: help with dynamic function call in legacy code Reply with quote

Master

Joined: 23 Jul 2009
Posts: 297

I've a legacy project in which just about everything is hardcoded. The project is coded in WMB 6.0, and will run on a 6.0 Message Broker kept around for sentimental reasons.

My wish is to remove some of the hardcoding, and hook up this flow to the configuration database used by newer projects. I need to do so without changing some of the core (mapping) code in this flow, because that would greatly increase time needed for regression testing.

Part of the solution I would like to try involves reading the name for the appropriate mapping function from a table and then dynamically calling that function - as opposed to the hugely complicated label-based flow in the current version.

The functions are defined in separate ESQL files, but all within the same schema:
Code:
/project/com/myname/mappings/mappingTypeP.esql – CREATE FUNCTION mappingTypeP( INOUT env REFERENCE, INOUT inputLocalEnv REFERENCE, … )
/project/com/myname/mappings/mappingTypeQ.esql – CREATE FUNCTION … etc
/project/com/myname/mappings/mappingTypeR.esql - …
…


My first idea had been to call these using EVAL - ignoring for the moment the performance implications for this method:
Code:
EVAL('CALL com.myname.mappings.mappingTypeP(InputLocalEnv, InputRoot, ...) into r;');


However, this results in the following exception:
Code:
2230 ImbComputeNode::evaluate
2488 com.myname.flow.DO_MAPPING.Main, 14.3, EVAL(s), Unknown function,SqlStatementGroup::execute,
2558 , 1.6, com.myname.mappings, mappingTypeP(),SqlCallableFunctionFnCall::resolve()


A hardcoded function call (using a CASE/WHEN block) does work in this place.

I tried to implement the 'trick' from http://www.mqseries.net/phpBB2/viewtopic.php?t=47263 by inserting all possible function calls hardcoded into an IF( some false expression )THEN block, but the same exception followed (and this isn't as 'pretty' as I would've liked in any case).

It isn't strictly necessary for me to dynamically address these mapping functions: it's too much work (especially re. testing) to change all of the code, so for now it suffices for me to make the target queues configurable - but I'd *like* to go a bit beyond that, and find a way to dynamically call these ESQL mapping functions - even though I will still have to redeploy the flow every time anything changes (at the very least, it might save some time in future maintenance).

Does anyone know if this kind of trick can be done in MB6?

Thanks!
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Dynamic ESQL and Dynamic Function Calling.
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.