On Thu, 5 Dec 2013 13:48:36 +0400
d b <[email protected]> wrote:

>   Now, I want to write prepared statement for above query.
> 
>   select * from emp order by ? ?; //I want to substitute column name
> and sorting preference.

Remember that parameters stand for data, not SQL.  You can use a
placeholder anywhere your query has literal data, but not for things
like column names and table names.  

I've often wished for a macro/template feature in SQL to express a
query independent of the names involved.  But I'm glad it's not part of
the language, for fear of how it might be used.  

--jkl
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to