On Fri, Mar 19, 2010 at 03:13:19PM -0400, Vance E. Neff scratched on the wall:
> First of all, I apologize for hijacking the thread!  I did not intend 
> to, I just screwed up!
> 
> Second:
> Question about binding:
> 
> I know how to prepare an INSERT state, for example:
> INSERT into table1 values (?, ?, ?);
> and in the wrapper I am using I can specify the index # (1, 2 or 3) of
> the column and the value in order to set the values.
> 
> The question is:
> How to do this with an update statement?  Is there a way to specify the
> index of the columns used in the where clause?  Such as:
> UPDATE table1 set (?, ?, ?) WHERE col1=? and col2=?;

  You can't do that.  You can only bind values where you would
  otherwise use a literal.  In specific, you cannot bind identifiers
  (e.g. column names) or SQL phrases.

  You need to do something like:

  UPDATE table1 SET col1=?, col2=?, col3=? WHERE col1=? AND col2=?


    -j


-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to