ADVANCED MOCA AND GROOVY
There are some more advanced features of MOCA. • We can check for null values or use the #onstack to see if a variable is on the MOCA context stack. • onstack Check if (@adr_id#onstack != 0) { publish data where adr = 'They gave us a address ID!' } Checking for NULL values continued... • NULL Check if (@adr_id != '' ) { publish data where adr = 'They gave us a address ID!' } If (@adr_id is not null ) { publish data where adr = 'They gave us a address ID!' } Joining Data using publish data. • The & can be used to join data with publish data. • Similar to using & to join result sets when executing two commands. • In the example below we are using publish data to create a two row result set. publish data where a = 1 and b = 2 and c = 5 & publish data where a = 2 This is what we get on context stack: a b c 1 2 3 2 Being careful with context. • Variables with the same name will over write previous variables. • The rows published to the cont...

































Comments
Post a Comment