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 » Set domain dynamically in the create statement

Post new topic  Reply to topic
 Set domain dynamically in the create statement « View previous topic :: View next topic » 
Author Message
KIT_INC
PostPosted: Fri Jan 28, 2011 8:35 am    Post subject: Set domain dynamically in the create statement Reply with quote

Knight

Joined: 25 Aug 2006
Posts: 589

I like to assign the domain name to the create statement dynamically. So I use ESQL

DECLARE DN CHAR ;
set DN=FIELDNAME(InputRoot.*[<]);
Create FIRSTCHILD of Environment DOMAIN '{DN}' Name 'XXMYDATA';
But {DN} did not get substitute with MRM or XMLNSC. I think this is because of the single quot around it.

I tried
Create FIRSTCHILD of Environment DOMAIN {DN} Name 'XXMYDATA';
I got syntax error because create expect ' ' around domain specified.

I tried
Create FIRSTCHILD of Environment DOMAIN '{FIELDNAME(InputRoot.*[<])}' Name 'XXMYDATA';
with no luck. It will deploy. But error out with trace output showing
The DOMAIN name ''{FIELDNAME(InputRoot.*[<])}'' is an invalid Root Element Name.

Any idea on how to do this ?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jan 28, 2011 8:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Code:
DOMAIN '''||{DN}||'''


Back to top
View user's profile Send private message
KIT_INC
PostPosted: Fri Jan 28, 2011 8:59 am    Post subject: Reply with quote

Knight

Joined: 25 Aug 2006
Posts: 589

Thanks mqjeff, but it did not work. Error in trace still says

''SET DN = FIELDNAME(InputRoot.*:*[<]);'' at ...... :
The result was '''MRM'''.
:
:
The DOMAIN name '''||{DN}||''' passed to the DOMAIN clause of the CREATE statement is not a valid Root Element Name.
The DOMAIN name '''||{DN}||''' is an invalid Root Element Name.
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Jan 28, 2011 10:46 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Did you try:

Code:
Create FIRSTCHILD of Environment DOMAIN DN Name 'XXMYDATA';



?
_________________
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
Featherstone
PostPosted: Mon Jan 31, 2011 2:31 am    Post subject: Reply with quote

Novice

Joined: 18 Oct 2010
Posts: 11

As mgk has stated the following should work

Code:
DECLARE DN CHAR ;
set DN=FIELDNAME(InputRoot.*[<]);
Create LASTCHILD of OutputRoot DOMAIN DN Name DN;
CREATE LASTCHILD OF OutputRoot.*[<] NAME 'TestSample' VALUE 'foo';


Help has:

Quote:

DOMAIN clause:
If present, the DOMAIN clause associates the new field with a new parser of the specified type. This clause expects a root field name (for example, XMLNS or MQRFH2).


Specifying the NAME as well as the DOMAIN class as using the variable DN will give the results you want.
Back to top
View user's profile Send private message
KIT_INC
PostPosted: Mon Jan 31, 2011 8:26 am    Post subject: Reply with quote

Knight

Joined: 25 Aug 2006
Posts: 589

Thanks a lot for all the help
Create FIRSTCHILD of Environment DOMAIN DN Name 'XXMYDATA'; works
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 » Set domain dynamically in the create statement
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.