Ok. Thanks. Here they are:
The error message is literally only: Error in SQL syntax
I was trying to add a repeating row but I have stripped all of that out leaving only the seven lines in the header. That's how I narrowed it down to the execute function.