internal database scripts for settlement