I’m trying something like this, but compound sets does not exists anymore. Someone could please help me?

Best answer by deannezhang
For every i,j in the sql procedure result, you want to obtain the distance and such route exists, right? If so, a parameter with following definition should work.
routeexists(i,j):= (distance(i,j) > 0)
so you do not need the last row in the mapping, but calculate the parameter after reading from DB.