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 » IBM ACE 12 SET/CREATE field if source exists

Post new topic  Reply to topic
 IBM ACE 12 SET/CREATE field if source exists « View previous topic :: View next topic » 
Author Message
AIIBA
PostPosted: Mon Nov 07, 2022 7:30 am    Post subject: IBM ACE 12 SET/CREATE field if source exists Reply with quote

Newbie

Joined: 07 Nov 2022
Posts: 3

Hello everyone,

Using IBM ACE 12.0.3.0 version, on a Windows environment,
Is it possible to create the entire tree structure of a field only if the source mapping value exists?


To give an example:
Code:
SET OutputRoot.XMLNSC.Object.Subject.Item.val = InputRoot.XMLNSC.AnotherObject.AnotherItem.value;

What I am trying to achieve is the creation of the full output XML path (Object/Subject/Item/val) only if the input element (AnotherObject/AnotherItem/value) exists.
It seems that if the input element is missing, then the val field isn't created indeed, but the rest of the path (Object/Subject/Item) it is being created anyway.

Is it possible without explicitly verifying the existence of the input element?

Many thanks in advance!
Back to top
View user's profile Send private message
timber
PostPosted: Wed Nov 09, 2022 12:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Quote:
Is it possible without explicitly verifying the existence of the input element?
Not if you use ESQL. You will need to use IF EXISTS ref.parent.child.field[]
(and don't forget to add the [] even if the field is not an array!)

I assume that you know about IF EXISTS already, but you have a good reason for wanting to avoid that option. If a non-ESQL solution is allowed then you may find that an XSLT transform can do what you need.
Back to top
View user's profile Send private message
abhi_thri
PostPosted: Wed Nov 09, 2022 1:48 am    Post subject: Reply with quote

Knight

Joined: 17 Jul 2017
Posts: 516
Location: UK

hi...similarly to IF EXISTS, you could use FIELDTYPE(<fieldpath>) IS NOT NULL or FIELDVALUE(<fieldpath>) IS NOT NULL to achieve the same.
Back to top
View user's profile Send private message
AIIBA
PostPosted: Thu Nov 10, 2022 2:54 am    Post subject: Reply with quote

Newbie

Joined: 07 Nov 2022
Posts: 3

Hi guys,

Thanks a lot for your clarifications. I was hoping there is a behavioral tweak in ESQL that I was missing.

Much appreciated!
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 » IBM ACE 12 SET/CREATE field if source exists
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.