Fri Aug 19, 2022 5:50 pm
Login Register Lost Password? Contact Us

Please Note: The HPCC Systems forums are moving to Stack Overflow. We invite you to post your questions on Stack Overflow utilizing the tag hpcc-ecl (https://stackoverflow.com/search?tab=newest&q=hpcc-ecl). This legacy forum will be active and monitored during our transition to Stack Overflow but will become read only beginning September 1, 2022.



Field Removal from Record Definition

Comments and questions related to the Enterprise Control Language

Tue Aug 06, 2019 7:37 pm Change Time Zone

Hi Guys,

Is it possible to remove one (or more) fields from a record definition that uses another record definition?

Code: Select all
lMyLayout01 := RECORD
  STRING field01;
  STRING field02;
  STRING fieldToRemove;
END;


/*****
* Remove 'fieldToRemove' from lMyLayout01 here, so we would have, field01, field02 and field03.
*****/
lMyLayout02 := RECORD
  lMyLayout01;
  STRING field03
END;


If Im not wrong, I saw something like this during the ECL course, but I wasn't able to find.

Thanks in advance,

Att.
Artur Baruchi
abaruchi
 
Posts: 19
Joined: Thu Apr 18, 2019 4:50 pm

Tue Aug 06, 2019 7:59 pm Change Time Zone

Artur,
Is it possible to remove one (or more) fields from a record definition that uses another record definition?
Yes. In the RECORD structure docs look at the section titled "Field Inheritance" and you'll see the exception list format, like this:
Code: Select all
lMyLayout01 := RECORD
  STRING field01;
  STRING field02;
  STRING fieldToRemove;
END;


/*****
* Remove 'fieldToRemove' from lMyLayout01 here, so we would have, field01, field02 and field03.
*****/
lMyLayout02 := RECORD
  lMyLayout01 AND NOT fieldToRemove;
  STRING field03
END;

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1619
Joined: Wed Oct 26, 2011 7:40 pm


Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest

cron