Posted: Thu Feb 28, 2013 7:11 pm Post subject: Re: I need some help with the syntax for a CARDINALITY array
Grand Master
Joined: 25 Jun 2008 Posts: 1415
mqjeff wrote:
You should never write your own code that uses CARDINALITY unless you actually need to know the literal count and use that as a specific individual value.
You should always write any kind of loop in ESQL using a reference variable and MOVE and LASTMOVE to confirm you should continue iterating.
It's an immense improvement in performance, and is the recommended practice.
Maybe that's overstated a bit. Sometimes, the performance improvement is not all that immense.
The often overlooked FOR statement may be better suited for iterating through an array; the reference variable, MOVE, and LASTMOVE are built-in. (Although the "correlation_name AS field_reference" syntax seems a bit backward, compared to how "AS" works elsewhere.)
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