This is still not working correctly, but the syntax looks better, and at least I still get the .csv output now.  I am not getting any tables inserted into the database, so the problem is probably there.