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 » Reference To Shared Variables

Post new topic  Reply to topic
 Reference To Shared Variables « View previous topic :: View next topic » 
Author Message
mustang
PostPosted: Mon Mar 16, 2009 12:54 pm    Post subject: Reference To Shared Variables Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 72

We want to create a common function or procedure that will refresh shared variables. This function/procedure would often be called from esql that is in a different schema (but will reference the schema in the path statement).

ESQL from calling function:
Declare CacheTable Shared Row;
Call setCacheTables('DB04', '0001', CacheTable);

ESQL from procedure
CREATE PROCEDURE setCacheTables (In db Char, In tableID Char, InOut CacheTable Reference)
Results in this runtime error:
bip2933 A function or procedure was called but the value supplied for the '&1' parameter was not a reference to a reference variable but the definition of the function/procedure requires a reference to a reference variable.

CREATE PROCEDURE setCacheTables (In db Char, In tableID Char, InOut CacheTable Row)
Results in this deploy time error:
BIP2402E: (hennepin.co.hjip.common.routines.setUTSTables, 1.7 : Syntax error : 'keyword Row'.
The token caused a syntax error.
Correct the syntax of your ESQL expression in node 'hennepin.co.hjip.common.routines.setUTSTables', around line and column '1.78', then redeploy the message flow.

Any suggestions would be much appreciated.

Thanks!
Back to top
View user's profile Send private message
jharringa
PostPosted: Mon Mar 16, 2009 12:57 pm    Post subject: Reply with quote

Acolyte

Joined: 24 Aug 2007
Posts: 70

I believe that you need to send in a message tree for this. You can't just send through a row.
Back to top
View user's profile Send private message
Hari
PostPosted: Mon Mar 16, 2009 1:22 pm    Post subject: Reply with quote

Centurion

Joined: 21 Nov 2002
Posts: 117
Location: USA

The msg is self explanatory, you are passing a row instead of a reference.
Back to top
View user's profile Send private message
mustang
PostPosted: Tue Mar 17, 2009 5:48 am    Post subject: Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 72

I apologize. I was not as clear as I should have been. I understand the error messages. My question is, should I declare the shared variable as something other than ROW? If so, what should that be? Alternatively, is there a way for the ROW to be modified in the procedure?

Thanks!
Back to top
View user's profile Send private message
jharringa
PostPosted: Tue Mar 17, 2009 5:52 am    Post subject: Reply with quote

Acolyte

Joined: 24 Aug 2007
Posts: 70

You could pass a message tree into the procedure and then copy the resulting tree into the ROW. Unfortunately that will cost you a tree copy on top of your query.
Back to top
View user's profile Send private message
mustang
PostPosted: Tue Mar 17, 2009 5:55 am    Post subject: Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 72

Thanks!
Back to top
View user's profile Send private message
mustang
PostPosted: Tue Mar 17, 2009 7:36 am    Post subject: Reply with quote

Acolyte

Joined: 07 Feb 2006
Posts: 72

This worked:

Changed
CREATE PROCEDURE setCacheTables (In db Char, In tableID Char, InOut CacheTable Reference)

To this
CREATE PROCEDURE setCacheTables (In db Char, In tableID Char, In CacheTable Reference)

Thanks!
Back to top
View user's profile Send private message
rekarm01
PostPosted: Tue Mar 17, 2009 1:46 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

mustang wrote:
This worked:

Changed
CREATE PROCEDURE setCacheTables (In db Char, In tableID Char, InOut CacheTable Reference)

To this
CREATE PROCEDURE setCacheTables (In db Char, In tableID Char, In CacheTable Reference)

Thanks!

Really?

I would have tried this:
Code:
CREATE PROCEDURE setCacheTables (In db Char, In tableID Char, InOut CacheTable ROW)
Back to top
View user's profile Send private message
jharringa
PostPosted: Tue Mar 17, 2009 2:29 pm    Post subject: Reply with quote

Acolyte

Joined: 24 Aug 2007
Posts: 70

It doesn't appear to work for me (after some quick tests...). Maybe there has been a fix after 6.1.0.1?


Back to top
View user's profile Send private message
whiting
PostPosted: Mon Mar 30, 2009 9:45 am    Post subject: Shared Variable Reply with quote

Acolyte

Joined: 26 Mar 2002
Posts: 64
Location: Greenville, SC

Is there something special required to make the scope of the shared vriable Execution group. When I try to update the variable from flow2, It get's its own copy of the variable with an initial value of zero.

//Bill
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Mon Mar 30, 2009 1:47 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hello.

REFERENCE is the correct datatype to use here as ROWs cannot be passed to or from an ESQL Procedure or Function.


Kind Regards,
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Reference To Shared Variables
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.