开发者

Am I able to run SQL functions on a ContentResolver columns query?

I am wondering if Android's ContentResolver supports using SQL functions over the columns when you query a ContentProvider. Such as SQLit开发者_运维知识库e3 date functions, to get a specific date format, or datediff?

What do you know about this?


No. Even if you find it works for some cases, you cannot assume it works across the board.

ContentProvider is a facade. A given ContentProvider might use SQLite. It might use XML files. It might use JSON files. It might use CSV files. It might use some third-party SQL database. It might use some third-party object database. It might not have much of any local content, but instead have its stuff out in the cloud, reached via Web service calls. You can't even be sure that a ContentProvider necessarily supports a classic SQL WHERE clause -- some XML-backed ContentProvider might use XQuery syntax instead.

Hence, you definitely cannot rely upon a ContentProvider even knowing what datediff is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜