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 » SELECT field scalar only to LIST@ROW

Post new topic  Reply to topic
 SELECT field scalar only to LIST@ROW « View previous topic :: View next topic » 
Author Message
MatthewDCampbell
PostPosted: Thu Nov 11, 2021 11:58 pm    Post subject: SELECT field scalar only to LIST@ROW Reply with quote

Novice

Joined: 29 Sep 2020
Posts: 21

Using IBM Integration 9.0

Read through the SELECT documentation but unclear if SELECT can grab field scalars into a LIST:

Code:

DECLARE Activities ROW;

SET Activities.[] = SELECT ITEM M.JSON.Data.SpanId
    FROM InputRoot.Collection.message[] AS M;


Above Activities has a LIST of ROW fields where each ROW has the Field name "SpanId" and scalar value from the JSON data.

What I would like is just the scalars in the LIST just like when using the LIST constructor with scalars:

Code:

SET Activities.[] = List{'gary', 'hank', 'big jim'}


Using FIELDVALUE before ITEM is a no helper.

Have combed this forum but not seeing anything similar. If a LIST can be constructed with scalar then SELECT ought to be able to mimic the LIST constructor. Or?
Back to top
View user's profile Send private message
MatthewDCampbell
PostPosted: Fri Nov 12, 2021 2:19 am    Post subject: Test case Reply with quote

Novice

Joined: 29 Sep 2020
Posts: 21

Answering with a test case:

Code:

-- Arrange
DECLARE records ROW;
SET records.things[] = LIST{ROW(5 AS Thing), ROW(10 AS Thing)};
      
   
-- Act
DECLARE scalers ROW;

FOR record AS records.things[] DO
   CREATE LASTCHILD OF scalers VALUE record.Thing;
END FOR;
   
   
-- Assert
IF scalers.[] <> LIST{5,10} THEN
   THROW USER EXCEPTION CATALOG 'UnitTest';
END IF;


Debugger shows a blank placeholder for the LIST scalers which I read wrong as a ROW with no field name.
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 » SELECT field scalar only to LIST@ROW
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.