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 » Accessing a SHARED variable from with a different Schema

Post new topic  Reply to topic
 Accessing a SHARED variable from with a different Schema « View previous topic :: View next topic » 
Author Message
timjohnarm
PostPosted: Sat Aug 27, 2016 5:58 pm    Post subject: Accessing a SHARED variable from with a different Schema Reply with quote

Apprentice

Joined: 28 Sep 2004
Posts: 40
Location: Melbourne Australia

I want to declare a SHARED variable either inside a SCHEMA or even in the Default, i.e., No Schema domain.

So in SharedRowDeclaration.esql I have
DECLARE SharedRow SHARED ROW;

My problem is I can't then access it from within CommonCode.esql where I have
BROKER SCHEMA com.nsd.commoncode

CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE SharedRef REFERENCE TO SharedRow;
END;

I get a warning about "Identifier SharedRow cannot be resolved".

Has anyone had any luck with this?
Back to top
View user's profile Send private message
adubya
PostPosted: Sat Aug 27, 2016 11:41 pm    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

When you declare the variable within a named SCHEMA then have you tried adding the PATH clause to the esql file of the code looking to use the variable ?
_________________
Independent Middleware Consultant
andy@knownentity.com
Back to top
View user's profile Send private message Send e-mail
timjohnarm
PostPosted: Fri Sep 02, 2016 7:19 pm    Post subject: Reply with quote

Apprentice

Joined: 28 Sep 2004
Posts: 40
Location: Melbourne Australia

I can't work out how to apply the schema name to a Global variable. I know how to do it for functions and procedures, but not for my Global variable.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Sep 02, 2016 8:34 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

adubya wrote:
When you declare the variable within a named SCHEMA then have you tried adding the PATH clause to the esql file of the code looking to use the variable ?

And what happened when you tried this?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Sat Sep 03, 2016 2:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Quote:
or even in the Default, i.e., No Schema domain
Not recommended. I know you are experimenting, but best practice is to put all of your own ESQL into a broker schema. You wouldn't write a Java class without putting it into a package, would you?
Back to top
View user's profile Send private message
timjohnarm
PostPosted: Sun Sep 04, 2016 7:56 pm    Post subject: Reply with quote

Apprentice

Joined: 28 Sep 2004
Posts: 40
Location: Melbourne Australia

fjb_saper wrote:
adubya wrote:
When you declare the variable within a named SCHEMA then have you tried adding the PATH clause to the esql file of the code looking to use the variable ?

And what happened when you tried this?


Sadly it didn't help.

I've read through the documentation several times and its not at all clear on whether or not you can use a Schema qualifier for variables at all.
Back to top
View user's profile Send private message
mgk
PostPosted: Mon Sep 05, 2016 3:17 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

Quote:
its not at all clear on whether or not you can use a Schema qualifier for variables at all


The doc could be improved here, but essentially no you can't do this with variables, only functions. So the solution is to simply have a "getter" and / or "setter" in the schema for the variable(s) and call that cross schema instead.

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 » Accessing a SHARED variable from with a different Schema
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.