This question is actually in relation to aD ACS4.2, but I
suspect there's a little more TCL community around here...
I want to add in TCL a column to the result set returned by
db_multirow, or prehaps munge (once again, in TCL) one of the
columns returned. The technique I've come up with uses a bit
too much knowledge of the internal representation of these
result sets for my liking - surely there must be a cleaner way.
db_multirow assets assets {
select a.asset_id, a.filename
from qx_assets a
where whatever = something else
} {
upvar #[template::adp_level] "assets:[expr
{${assets:rowcount} + 1}]" assets
set assets(thumb_url) [qx_asset_url $asset_id
thumb $filename]
}
here the function qx_asset_url takes the asset_id and
filename results from the query and returns a bit of text which
appears to the template to be an additional column, thumb_url.
Is this really the best/only way of doing this?