> Le 5 oct. 2017 à 20:45, Stephen Chrzanowski <pontia...@gmail.com> a écrit :
> 
> Given the query:
> 
> select EventID, Airline, ContactInfo,TicketID,CreateDate from tEvents where
> Resolved=:Resolved order by :OrderBy
> 
> I wanted to bind :OrderBy with field names and conditions based on user
> preferences, but I think the bind converted my order rules into a string
> and ordered my results based on that string somehow.
> 
> Am I looking at a wrapper limitation or is this something SQL won't do and
> I'll have to rely on concatenation?  (Which I'm not bothered by since the
> sort options are hard coded)

Hello Stephen,

SQLite query arguments are for values only: they can't be used as placeholders 
for expressions such as a column name. Reference: 
https://sqlite.org/c3ref/bind_blob.html: 
<https://sqlite.org/c3ref/bind_blob.html:>

You're thus not facing a wrapper limitation: you do have to concatenate strings 
in order to build your dynamic SQL query.

Gwendal

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

Reply via email to