Zsbán Ambrus wrote:
>     CREATE VIEW vp AS SELECT ? AS x;
>
>     Error: parameters are not allowed in views
>
> This error seems reasonable, but I can't find anything about it in
> documentation.  Could you tell me where the documentation explains
> where exactly I can use parameters (bound parameters, variables,
> placeholders, question marks) in an expression?

I don't know about the documentation, but you must not use parameter
markers where they would be stored in the database, which is in _all_
these cases:

>  - The SELECT part in a CREATE VIEW statement.
>  - The default values of columns in a CREATE TABLE statement.
>  - The CHECK constraint expressions in a CREATE TABLE statement.
>  - The trigger conditions after WHEN in a CREATE TRIGGER statement.
>  - Inside statements in a trigger.

... even if SQLite isn't paranoid enough:

sqlite> create table t(x default ?);
Error: near "?": syntax error
sqlite> create table t(x default (?));
sqlite> insert into t default values;
sqlite> select quote(x) from t;
X''


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

Reply via email to