Makumba - set the void in the place where

I am wondering if there is a way to check for a given void in the mak: list where clause.

I would like you to not have to do mak: list the asked question only for mak: lastCount its size.

+3
source share
2 answers

Yes, since you can use subqueries in the WHERE clause.

Using data definitions from http://www.makumba.org/page/DataModelHowto , i.e. company.Company with a set

suppliers = set company.Company

you can do something like

<mak:list from="company.Company c" where="(SELECT count(s) FROM c.suppliers s) > 0">
....
</mak:list>

You can also define this as a function in MDD, for example. as

hasSuppliers() { (SELECT count(s) FROM suppliers s) > 0 }

and then use it in your <mak: list> a

<mak:list from="general.Company c" WHERE="c.hasSuppliers()">
....
</mak:list>
+2
source

hasSuppliers () can be defined simply as

hasSuppliers(){exists(FROM suppliers s)}
+1
source

All Articles