writes to SQL (one line at a time)
fixed some syntax issues with SQL_writer