It will depend the server backend.. However in general, I have never been 
successful (not just in Qt, at all) in binding for "lists"

I would do a "IN (:id1,:id2,:id3)" and have multiple binds

Scott


From: [email protected] 
[mailto:[email protected]] On Behalf Of 
Witold E Wolski
Sent: Tuesday, April 9, 2013 8:35 AM
To: [email protected]
Subject: [Interest] QSQLQuery bindValue to SELECT WHERE IN

Trying to bind a value to :

SELECT * from features WHERE id IN (:ids)

I tried 2 versions:
First, build a list with the ids I want to select.
Creating a QList<QVariant> qlist;
Second version building a QString (i.e. "1,2,3")
Than I bind it to the query above
query.bindValue(":ids",qlist);


But unfortunately with neither I get result. No errors too.

executing a query
SELECT * from features WHERE id IN (1,2,3)
works fine.

Can anyone please tell me the right solution please?
Best



--
Witold Eryk Wolski

Triemlistrasse 155
8047 Zuerich
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to