On Tue, Jul 3, 2012 at 4:18 PM, Yuriy Kaminskiy <yum...@gmail.com> wrote:
> Igor Tandetnik wrote: > > On 7/3/2012 10:05 AM, Unsupported wrote: > >> // case 1: exception > >> //verify(sqlite3_prepare_v2(db, "create trigger updater > >> update of result on plugins" > >> // " begin" > >> // " update mails set kav=case old.result when > >> 'infected' then ? else 0 end where uid=old.uid;" > >> // " end;" > >> // , -1, &stmt, 0) == SQLITE_OK); > >> //verify(sqlite3_bind_int(stmt, ++idx, -1) == SQLITE_OK); > > > > You can't use parameters with DDL statements (all kinds of CREATE > > SOMETHING, DROP SOMETHING et al). You can only parameterize DML > > statements - SELECT, INSERT, UPDATE and DELETE. > > Hmm... I don't think this is incorrect per se, but where is this > documented? > I have not found any warning about this in prepare/bind/lang_expr/... > documentation. > Igor is correct. Actually, you can bind on a DDL statement, but bindings are only valid for the lifetime of the statement itself, not for the whole lifetime of the object created by the CREATE statement. So doing such bindings are pointless. And you can't really bind to a DROP statement, because there are no expressions in a DROP statement to bind to. But these are all details. Igor's explanation is simple and to the point. Yuriy is also correct that I need to update the documentation to make this clear. Or, maybe even throw an error at prepare-time or run-time if you attempt to bind on a CREATE statement, so that people to don't normally ready the documentation will also become aware of the limitation. > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users