> In my code, I delete the view before attempting to recreate it by
> executing the prepared statement.  Isn't that the time to validate
> whether there are semantic problems with the statement?

Yes, "validation" happens only at the time of execution. So you are
apparently doing something wrong and you better show your code.

As to your initial question: the text of view is remembered by SQLite
as is for execution in future statements, so it would need to inline
your parameters anyway. And thus you can't use parameters in the view
creation.


Pavel

On Thu, Aug 26, 2010 at 7:12 AM, Alan Chandler
<a...@chandlerfamily.org.uk> wrote:
> On 26/08/10 10:22, Alan Chandler wrote:
>> I am using PHP PDO to access sqlite and have reached a peculiar error
>> situation.  Basically its saying I can't have parameters in a CREATE
>> VIEW sql statement when I am preparing it.
>
> The plot thickens
>
> I replaced all the parameter placeholders with a quoted version of the
> parameter and undertook the prepare statement again.
>
> This time it reported that the view it would have created failed because
> the table (view) already existed.
>
> Is it correct to undertake the semantic validation at prepare time?
>
> In my code, I delete the view before attempting to recreate it by
> executing the prepared statement.  Isn't that the time to validate
> whether there are semantic problems with the statement?
>
> The reason I was pre-preparing the statement was to limit the time I
> have to lock the database with a "BEGIN IMMEDIATE" (and the later
> "COMMIT").
> --
> Alan Chandler
> http://www.chandlerfamily.org.uk
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to