|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
IBM ACE 12 SET/CREATE field if source exists |
« View previous topic :: View next topic » |
Author |
Message
|
AIIBA |
Posted: Mon Nov 07, 2022 7:30 am Post subject: IBM ACE 12 SET/CREATE field if source exists |
|
|
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 |
|
 |
timber |
Posted: Wed Nov 09, 2022 12:58 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
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 |
|
 |
abhi_thri |
Posted: Wed Nov 09, 2022 1:48 am Post subject: |
|
|
 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 |
|
 |
AIIBA |
Posted: Thu Nov 10, 2022 2:54 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|