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 » Create Statement with Alias

Post new topic  Reply to topic
 Create Statement with Alias « View previous topic :: View next topic » 
Author Message
Amitha
PostPosted: Fri Aug 20, 2010 11:55 am    Post subject: Create Statement with Alias Reply with quote

Voyager

Joined: 20 Nov 2009
Posts: 80
Location: Newyork

Hi,

WMB 6.10.7, Windows XP.

I am using following ESQL expression to create an element in output tree with an alias reference:

Code:
CREATE LASTCHILD OF OutputRoot.XMLNSC.ParentMSG AS outputMsgRef NAME 'ChildMsg';

This is giving warning on toolkit Identifier "outputMsgRef" cannot be resolved.
During deploy time it throws up

Code:
BIP2432E: The correlation name 'outputMsgRef' is not valid. Those in scope are: Environment, InputLocalEnvironment, OutputLocalEnvironment, InputRoot, InputBody, InputProperties, OutputRoot, InputExceptionList, OutputExceptionList, InputDestinationList, OutputDestinationList, envVarRef



I wonder why this is not working, is this a bug or I am doing something wrong.

The following code works, I wanted to try alias reference with create statement.

Code:
CREATE LASTCHILD OF OutputRoot.XMLNSC.ParentMSG NAME 'ChildMsg';
      
DECLARE outputMsgRef REFERENCE TO OutputRoot.XMLNSC.ParentMSG.ChildMsg;
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Fri Aug 20, 2010 12:21 pm    Post subject: Re: Create Statement with Alias Reply with quote

Grand High Poobah

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

Have you tried:

Code:

DECLARE outputMsgRef REFERENCE TO OutputRoot;
...
CREATE LASTCHILD OF OutputRoot.XMLNSC.ParentMSG AS outputMsgRef NAME 'ChildMsg';

_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Amitha
PostPosted: Fri Aug 20, 2010 1:05 pm    Post subject: Reply with quote

Voyager

Joined: 20 Nov 2009
Posts: 80
Location: Newyork

Quote:
DECLARE outputMsgRef REFERENCE TO OutputRoot;
...
CREATE LASTCHILD OF OutputRoot.XMLNSC.ParentMSG AS outputMsgRef NAME 'ChildMsg';


Thanks this works. But I thought CREATE Statement will create reference variable just like FOR statement does.
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Fri Aug 20, 2010 4:33 pm    Post subject: Reply with quote

Grand High Poobah

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

Amitha wrote:
But I thought CREATE Statement will create reference variable just like FOR statement does.


Nope, just does a MOVE
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Aug 20, 2010 6:21 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
Amitha wrote:
But I thought CREATE Statement will create reference variable just like FOR statement does.


Nope, just does a MOVE


...

Really?

Interesting. I was not aware of that subtlety.
Back to top
View user's profile Send private message
Vitor
PostPosted: Sat Aug 21, 2010 4:42 pm    Post subject: Reply with quote

Grand High Poobah

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

mqjeff wrote:
Interesting. I was not aware of that subtlety.


AFAIK it's not stated in the documentation that it only does a move; nor does it state that CREATE doesn't need the reference pre-defined.

(Happy to be corrected there)

I just hit this problem a few years back and that's how I fixed it.
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Sun Aug 22, 2010 1:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Aug 22, 2010 12:21 am    Post subject: Reply with quote

Grand High Poobah

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

Even though it's not stated in the doc, AFAIK, in order to assign a reference in the CREATE statememt, that reference has to exist (be declared) first...

What I never tried was to combine the 2 statements...like


Code:
CREATE LASTCHILD OF OutputRoot.XMLNSC.ParentMSG AS DECLARE outputMsgRef NAME 'ChildMsg';


If anybody tried this let us know ... my guess is you'll get a syntax error.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Sun Aug 22, 2010 3:49 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
CREATE LASTCHILD OF OutputRoot.XMLNSC.ParentMSG AS DECLARE outputMsgRef NAME 'ChildMsg';


This cannot work as DECLARE is a statement, not an expression...

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 » Create Statement with Alias
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.