sql-input-extend refined