I am trying to store a file larger then 1MB in a SQLite db. Problem is that even though by default SQLite field can hold up to 950 MB or so and maximum length of an SQL statement is 1000000 (~970KB). There is a way described for C/C++ (http://www.sqlite.org/limits.html): Maximum Length Of An SQL Statement
The maximum number of bytes in the text of an SQL statement is limited to SQLITE_MAX_SQL_LENGTH which defaults to 1000000. You can redefine this limit to be as large as the smaller
I've done some work (untested as yet) in the direction you ask for. Here it is. I'm sorry to be unable to even perform the first basic syntax check on this. I'm currently quite busy with an important customer and I don't know when I'll be able to correct unavoidable cust&paste basic errors in the code provided. I apologize for that inconvenience. Only try and carefully check with sample DB, not production (if ever it passes syntax check!). I sincerely hope you can fix typos and basic errors