Forum OpenACS Development: Re: Can someone explain why nested queries such as db_foreach are not recommended?

db_foreach is mostly convenient when one has a query returning some big number of columns. In such case, when using e.g. db_list_of_lists, one would have to "peel" the results with a cumbersome lassign.

Using db_list_of_ns_sets would be a nicer replacement in this case, as it maintains a notion of which columns have been extracted in the ns_set. In fact, latest db_foreach implementation is just a wrapper around this api.