[task] Update script to make it can generate sql statement