attribute := expression : ONCE ;
attribute | The name of the attribute. |
expression | The definition of the attribute. |
The ONCE service allows you to specify that the code is to be executed only once at query load time.
This means a Roxie query will execute it only once even if the query is executed multiple times. For a Thor or hThor query, ONCE behaves the same as INDEPENDENT.
Example:
InlineDCT := DICTIONARY([{0 => 'Black' , 'Greys'},
{1 => 'Brown' , 'Earth'},
{2 => 'Red' , 'Reds'},
{3 => 'White' , 'Greys'} ],
{UNSIGNED code => STRING10 color ,STRING10 Tone}) : ONCE;
UNSIGNED v := 0 : STORED('v');
OUTPUT(InlineDCT[v].color);
See Also: INDEPENDENT