Fixed scan code to run on all supported DBMSs.