|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Dynamic ESQL and Dynamic Function Calling. |
« View previous topic :: View next topic » |
Author |
Message
|
shrek |
Posted: Thu Mar 02, 2006 2:48 am Post subject: |
|
|
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 |
|
|
moogoo |
Posted: Thu Mar 02, 2006 7:03 am Post subject: |
|
|
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 |
|
|
mgk |
Posted: Thu Mar 02, 2006 7:06 am Post subject: |
|
|
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 |
|
|
moogoo |
Posted: Thu Mar 02, 2006 7:55 am Post subject: |
|
|
Acolyte
Joined: 20 Sep 2002 Posts: 54 Location: US
|
|
Back to top |
|
|
moogoo |
Posted: Tue Mar 14, 2006 7:24 am Post subject: |
|
|
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 |
|
|
Gralgrathor |
Posted: Fri Oct 17, 2014 3:55 am Post subject: help with dynamic function call in legacy code |
|
|
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 |
|
|
|
|
|
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
|
|
|
|