On Mon, Jun 14, 2010 at 12:07:08PM -0300, Israel Lins Albuquerque scratched on 
the wall:
> Yes. I know that, but the names of parameters are different, 
> and I debug this and the parameter named as ':a' will be overwrited by '?1', 
> and if I use sqlite3_bind_parameter_index(stmt, ":a") will fail, returning 0. 
> But actually they are not the same. 

  Yes they are.  Names are just short-cuts to indexes.  Named
  parameters use "the first unused index."  You then set an explicit
  index that is already in use.  Each index can only have one name,
  so it is over-written with the last-used representation.

  To avoid such problems, it is strongly advised you do not mix
  parameter types.  Either use bare parameters, explicit indexes,
  or names-- but pick one and stick with it.


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

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
sqlite-users mailing list

Reply via email to