On May 23, 11:15 am, Joe Wilson <[EMAIL PROTECTED]> wrote:
> Because you are passing parameters to CREATE VIEW.
>
> It's correctly rejected for the same reason you cannot code
> "select ? from ?".

I understand why "select ? from ?" doesn't work--there are several
reasons for that.  But I don't see why "create view ... where key < ?"
doesn't work.  If I take that exact same line of Java (the
conn.prepareStatement line) and replace the word "view" with "table",
everything works perfectly.  Of course, it accomplishes a very similar
thing, the main catch is speed/space waste and the fact that
subsequent changes in the original table aren't reflected in the view
(I care more about the former issue than the latter).

It isn't clear to me why "create temp table as select ... where key
<?" works as a prepared statement, but the analogous line for views
doesn't.  Should the create table be disallowed as well?

Is there a generic JDBC spec somewhere that describes this in more
depth?  The normal Sun Java API docs that describe java.sql don't
really explain what kinds of sql can and can't be run as
preparedstatements, and what kinds of things are valid parameters.
--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to