With recent versions of SQLite, a prepare call fails when there are parameters in the SQL for a 'create view' statement. I stumbled into this for two reasons: The documentation for parameters and ..._prepare does not contra-indicate such usage; it seemed perfectly sensible; and it was useful in my application. (I have a complex view setup which I had wanted to vary, parametrically, when the view was queried.)

Upon thinking over how parameter substitution must be implemented, I can see that there may be difficulty with parameters in a view since its select appears to be stored as SQL, not subject to substitution at the time the view is created. However, that seems like a feature rather than a bug.

Would there be any downside to allowing named parameters to remain in a view's SQL?

I am tempted to offer a paragraph with which to enhance the doc page on parameters, explaining where they are allowed and where not. But I can only guess what it should say without a lot of experimentation or study of the code.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to