I have a long SQL statement 1,561 lines long (several SQL statements delimited by ;. It executes fine in the CLI but not within a programmatic call to sqlite3_exec using C#: it gives the error message in the title. There is NO 'on' clause. Any hints as regards the cause of the error would be a great help. My guess is that this is to do with UTF encoding ... but it is just a guess. I can't post the script as it would be meaningless without the database and I've no way of sharing the database.