bug 1010: changed sprintf to printf in db block