derived from import.vty.pl
quote input db_name
fix error at end