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. 


----- Mensagem original ----- 
De: "Jay A. Kreibich" <j...@kreibi.ch> 
Para: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> 
Enviadas: Segunda-feira, 14 de Junho de 2010 12:00:32 
Assunto: Re: [sqlite] Parametrized Queries issue (Possible bug) 

On Mon, Jun 14, 2010 at 11:51:07AM -0300, Israel Lins Albuquerque scratched on 
the wall: 
> Using the example above I see one not documented issue. When I use parameters 
> ?NNN and :AAAA or @AAAA or $AAAA , 
> in same query as above some of then will be omitted. I don't know if this is 
> the expected behavior or not. 
> 
> CREATE TABLE a (a, b); 
> CREATE TABLE b (a, b); 
> 
> INSERT INTO a VALUES (0, 1); 
> INSERT INTO a VALUES (1, 0); 
> INSERT INTO a VALUES (1, 1); 
> INSERT INTO b VALUES (0, 1); 
> INSERT INTO b VALUES (1, 0); 
> INSERT INTO b VALUES (1, 1); 
> 
> SELECT * 
> FROM a 
> JOIN b ON (a.a = b.a AND a.b = :b AND a.b = b.b) 
> WHERE a.a = ?1; 
> 
> In this query as 2 parameters but will be see like only one! 


It is expected. 

Nearly all SQL interfaces work this way. 

It is a feature. The same value will be used in both locations in 
the query. 

-j 

-- 
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 
sqlite-users@sqlite.org 
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 


-- 

Atenciosamente/Regards, 

Israel Lins Albuquerque 
Desenvolvimento/Development 
Polibrás Brasil Software Ltda. 


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

Reply via email to