SQLite Forum

Getting error when pipe sql into sqlite3 utility

I'm getting the following error on Windows when I pipe a SQL file into the sqlite3.exe prebuilt command line utility and the SQL file contains a UTF-8 BOM (as create by Notepad.exe in Windows).

    > SQLITE3.EXE test.db < cleanup.sql
    Error: near line 1: near "": syntax error

I believe there was a similar error reported a while ago, but that was from loading the SQL file from inside the utility which is not an option for me.

Currently I place a comment in the beginning of the file to avoid it skipping the first SQL command.

Any thoughts on how to avoid this?