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 » pass namespace qualified variables to a SELECT function?

Post new topic  Reply to topic
 pass namespace qualified variables to a SELECT function? « View previous topic :: View next topic » 
Author Message
gechu
PostPosted: Wed Jun 22, 2011 7:25 am    Post subject: pass namespace qualified variables to a SELECT function? Reply with quote

Apprentice

Joined: 27 Feb 2008
Posts: 48

I´m using the Mapping Node, which (I think) uses the MRM domain. The code I write is pseudocode, let me know if´s too ambigious. And this is what my source logical tree, variable declarations and SELECT function looks like:
Code:
$source/ns1:myRootElement/ns1:header/ns1:data/ns1:repeatingElement

ns1:repeatingElement
   ns1:qualifier = XYZ
   ns1:valueToBeReturned = '123'

DECLARE sourceRef REFERENCE '$source/ns1:myRootElement/ns1:header/ns1:data'
DECLARE myChar CHARACTER;
DECLARE ns1 NAMESPACE 'http://www.ford.com/oagis';

SET myChar = THE(SELECT ITEM I.{'ns1:valueToBeReturned'} FROM $sourcePath.{'ns1:repeatingElement'}[] AS I WHERE I.{'ns1:qualifier'} = 'XYZ');


All values in the curly brackets are character variables but for clarity I´ve replaced them with their actual values. The passing of "sourceRef" works. I think I have problems passing other values (the ones inside curly brackets) which I use in a SELECT function.

I´m not sure, but I think the SELECT fails because the way I access elements using namespaces. But I am not sure. Any clues why it doesn´t work?


UPDATE: this is related to the way I access elements.

This is what I tried and it worked!

Code:
DECLARE testingRef REFERENCE TO sourceRef;
MOVE testingRef  FIRSTCHILD NAMESPACE 'http://www.theNamepace/used' NAME 'repeatingElement';


In my SELECT function, in the FROM section and other section too, I want to achieve the same thing, but I guess the syntax i wrong. Here is the code extracted from the SELECT funtion:

Code:
FROM $sourcePath.{'ns1:repeatingElement'}[]


How can I write that line with namespace support?


Just a note, this kind of function have proven useful when dealing with SAP and OAGIS XML structures.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 22, 2011 9:44 am    Post subject: Reply with quote

Grand High Poobah

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

Have you tried:
Code:
from $sourcePath.ns1:{'repeatingElement'}

or even
Code:
from $sourcePath.{myns}:{myelt}


And there is always the EVAL statement .... including the caveat for performance...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
gechu
PostPosted: Wed Jun 22, 2011 11:40 pm    Post subject: Reply with quote

Apprentice

Joined: 27 Feb 2008
Posts: 48

Both worked! Thanks a lot man!
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 » pass namespace qualified variables to a SELECT function?
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.