Hi!
I'm just trying to get SUM(PARTS, WEIGHT) working with WEIGHT being "TYPE WEIGHT POSSREP {WEIGHT RATIONAL};"
I end up with
ERROR: RS0055: Could not find operator SUM(RELATION {PID P#, NAME NAME, COLOR COLOR, WEIGHT WEIGHT, CITY CHARACTER, %attributeName5 WEIGHT}, INTEGER)
I've tried defining OP_PLUS, but without much more success.
Any hint?
Thanks a lot,
Bernard
SUM on user-defined type
Re: SUM on user-defined type
Try SUM(PARTS, THE_WEIGHT(WEIGHT))
Re: SUM on user-defined type
Lol, sure. But what if it makes sense to consider that WEIGHT + WEIGHT -> WEIGHT and I want to have SUM working out of the box?
Re: SUM on user-defined type
Sorry, at present you can't, because the built-in aggregate operator SUM is only defined over INTEGER and RATIONAL.
A future update will support user-defined aggregate operators, which will permit defining SUM over user-defined types.
A future update will support user-defined aggregate operators, which will permit defining SUM over user-defined types.