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 » Can Environment tree be used inside the FUNCTION/PROC?

Post new topic  Reply to topic
 Can Environment tree be used inside the FUNCTION/PROC? « View previous topic :: View next topic » 
Author Message
wmb_wps_soa
PostPosted: Mon Feb 07, 2011 1:31 pm    Post subject: Can Environment tree be used inside the FUNCTION/PROC? Reply with quote

Acolyte

Joined: 19 Feb 2010
Posts: 65
Location: Detroit,Michigan,USA.

Hi Guys,

Can Environment. tree be used inside the FUNCTION or PROCEDURE and send out to the calling main message flow?

In this case, i just want to construct an Environment tree with list of parameters in the esql PROCEDURE, and I need to send the Environment back to the main flow.

But, I am getting error, could not use SET or CREATE FIELD inside the esql procedure. Could anybody help?

In the main flow:
--------------------------
DECLARE ListRef REFERENCE TO InputRoot.MRM;
CALL store_EnvironmentLList(ListRef);

In the ESQL procedure:
-------------------------------------
CREATE PROCEDURE store_EnvironmentLList(IN handlerListRef REFERENCE,OUT environmentRef REFERENCE)
BEGIN
CREATE FIELD Environment.HandlerList;
SET Environment.HandlerList.SQLList[1].Name = 'Test';
CREATE FIELD Environment.HandlerList.SQLList[1].Name VALUE 'Test';
END

SET and CREATE, both did not worked. Can anybody help?

Thanks,
Jeba
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Feb 07, 2011 1:39 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Firstly, why are you doing this?

Secondly, why does your procedure definition have 2 parameters but the call only one?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
wmb_wps_soa
PostPosted: Mon Feb 07, 2011 1:43 pm    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2010
Posts: 65
Location: Detroit,Michigan,USA.

The requirement is to Build an Environment Tree with the database details that can be used to consturct a dynamic delete when an exception occurs.

I am passing only one parameter as INPUT reference to the parameter. And the procedure should return the Environment.Tree as OUTPUT.

Can you help how can I build the Environment.Tree inside the Procedure/Function?

Thanks
Jeba
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Feb 07, 2011 1:52 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

wmb_wps_soa wrote:
I am passing only one parameter as INPUT reference to the parameter. And the procedure should return the Environment.Tree as OUTPUT.


My question stands - why does the call have a different number of parameters to the definition? Given what you're attempting? Which can be achieved if coded differently.

wmb_wps_soa wrote:
Can you help how can I build the Environment.Tree inside the Procedure/Function?


No. I don't understand why the code you've posted doesn't throw a syntax error.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
wmb_wps_soa
PostPosted: Mon Feb 07, 2011 2:02 pm    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2010
Posts: 65
Location: Detroit,Michigan,USA.

Yes, I was wrong. It was like this:

In the main flow:
--------------------------
DECLARE ListRef REFERENCE TO InputRoot.MRM;
DECLARE environmentRef REFERENCE TO Environment.DbHandler;
CALL store_EnvironmentLList(ListRef,environmentRef);



In the ESQL procedure:
-------------------------------------
CREATE PROCEDURE store_EnvironmentLList(IN handlerListRef REFERENCE,INOUT environmentRef REFERENCE)
BEGIN
SET Environment.HandlerList.SQLList[1].Name = 'Test';
SET Environment.HandlerList.SQLList[1].Value= 1111;
SET Environment.HandlerList.SQLList[2].Name = 'Test';
SET Environment.HandlerList.SQLList[2].Value= 2222;
END

It did not worked, it was throwing error. Is there any specific way we should use while building the Environment Tree inside the Procedure or Function?

Thanks
Jeba
Back to top
View user's profile Send private message
wmb_wps_soa
PostPosted: Mon Feb 07, 2011 2:12 pm    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2010
Posts: 65
Location: Detroit,Michigan,USA.

Thank you Grand Poobah.

It worked Atlast.

In the main flow:
--------------------------
DECLARE ListRef REFERENCE TO InputRoot.MRM;
CREATE FIELD Environment.DbHandler;
DECLARE environmentRef REFERENCE TO Environment.DbHandler;
CALL store_EnvironmentLList(ListRef,environmentRef);

In the ESQL procedure:
-------------------------------------
CREATE PROCEDURE store_EnvironmentLList(IN handlerListRef REFERENCE,INOUT environmentRef REFERENCE)
BEGIN
SET environmentRef.SQLList[1].Name = 'Test';
SET environmentRef.SQLList[1].Value= 1111;
SET environmentRef.SQLList[2].Name = 'Test';
SET environmentRef.SQLList[2].Value= 2222;
END


It worked fine and returning the Environment Tree as expected.

Thank you

Jeba
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Feb 07, 2011 3:50 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You haven't mentioned the most important point, which is the version of Broker that you're using.

You should only need to send in an Environment reference like this in version 6.0, not in 6.1 or 7.

And version 6.0 goes out of support in April, so it's not too clear why you're doing new development with it.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Feb 07, 2011 6:20 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

wmb_wps_soa wrote:
It worked fine and returning the Environment Tree as expected.


I still don't understand why you'd want to do this. Even if it does work now you've fixed the ludicrous error.

For the record, you could also have made it work with 1 parameter defined as INOUT.

This would not have made any more sense than your version IMHO.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
wmb_wps_soa
PostPosted: Tue Feb 08, 2011 10:42 am    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2010
Posts: 65
Location: Detroit,Michigan,USA.

Thank you for the replies.

The message broker version I am using is 7.0.0.1.

Let me give the details:

I just wanted to build an environment tree dynamically in the esql procedure based on the input message.

This newly built environment tree will then be used across all the nodes in the message flow.

Thank you

Jeba
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 08, 2011 10:58 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

wmb_wps_soa wrote:
This newly built environment tree will then be used across all the nodes in the message flow.


Used for what? What are you recording from the input message that needs to be preserved like this? And why hold it in the Environment?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
wmb_wps_soa
PostPosted: Tue Feb 08, 2011 11:10 am    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2010
Posts: 65
Location: Detroit,Michigan,USA.

Hi,

The input message will have the details abo
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 08, 2011 12:38 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

wmb_wps_soa wrote:
The input message will have the details abo


Will it now? Well that clears everything up...
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Can Environment tree be used inside the FUNCTION/PROC?
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.