While Valentina have very cool syntax for recursive queries, one Valentina developer have point us that it cannot be used in his task, because he do not have predefined link with name. Taking this into account, for v5.0 we have extend syntax of recursive query
from USING link_name
to USING (link_name | search_condtiion)
Lets remember how we define the join condition:
FROM T1 join T2 ON T1.id = T2.ptr
Note, that in general, the foreign key can be even not defined, but this join still will work in RDBMS.
Now you can do similar for a recursive query:
ANCESTORS OF 4 ON LEVEL 2 USING T1.id = T1.ptr
just specify some recursive join condition and Valentina will use that as a temporary link to resolve recursion. Note, that this condition must have full specification of fields. Besides, the TableName should be the same for both fields, because we must have a self-recursive link.