WHILE LASTMOVE(refToRecordData) DO
SET OutputRoot.XMLNSC.CreateRecord.CaseList.DynamicCase.Key[count] = refToRecordData.Key;
IF FIELDNAME(refToRecordData.Value.StringValue)= 'StringValue' THEN
SET OutputRoot.XMLNSC.CreateRecord.CaseList.DynamicCase.Value[count] = refToRecordData.Value.StringValue;
ELSE
IF FIELDNAME(refToRecordData.Value.Attributes)= 'Attributes' THEN
DECLARE refToAttributes REFERENCE TO refToRecordData.Value.Attributes;
WHILE LASTMOVE(refToAttributes) DO
SET OutputRoot.XMLNSC.CreateRecord.CaseList.DynamicCase.Value.DynamicCase.Key[attrCount] = refToAttributes.Key;
SET OutputRoot.XMLNSC.CreateRecord.CaseList.DynamicCase.Value.DynamicCase.Value[attrCount] = refToAttributes.Value;
MOVE refToAttributes NEXTSIBLING REPEAT TYPE NAME;
SET attrCount = attrCount +1;
END WHILE;
END IF;
END IF;
MOVE refToRecordData NEXTSIBLING REPEAT TYPE NAME;
SET count = count +1;
END WHILE;
Posted: Wed Dec 02, 2015 5:21 am Post subject: Re: Need help on ESQL code
Partisan
Joined: 17 Apr 2014 Posts: 358
anilmekala wrote:
SET OutputRoot.XMLNSC.CreateRecord.CaseList.DynamicCase.Value.DynamicCase.Key[attrCount] = refToAttributes.Key;
SET OutputRoot.XMLNSC.CreateRecord.CaseList.DynamicCase.Value.DynamicCase.Value[attrCount] = refToAttributes.Value; il.
use CREATE STATEMENT instead of SET. Syntax in the knowledge centre.
and if you use the debugger, you can see how the message tree is being built in both cases, and what the difference between the two methods.
Having said that, you can also use a SELECT statement , which will be a lot more efficient.
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