And this is a fine example of the kind of Heath Robinson contraption that has to be used because SQLite does not support stored procedures. Anyone still wanting to stick to *"nobody needs stored procedures"*? I *do* need them and looking at this others do to.