Android Sqlite in, Syntax---not int (?)

Source: Internet
Author: User

Processing where column_name not in (?) : If it is followed by a string of characters or combinations of numbers, it cannot be used directly (?). , and these character combinations should be used directly as part of the conditional string.

1. Where column_name not in (' name1 ', ' name2 ')

2.DB.Query (table, new String[]< Span class= "PLN" > { "id" }, String. ( "type not in (%s)" , Argsarraytostringarraysnull, null null, null

You cannot place just one '? ' instead of a list of values. As such, there is little to gain from trying to parametrize lists. One can, of course, create 2,4,16-value prepared statements but ..." type NOT IN (?,?)", new String[]{ "connect","answer" },... even in a server with remote RDBMS it had Questionab Le value. Istead, do

  db. (table, new String [] {  "id"  ,   "}, " type not in (' Connect ', ' answer ') ", null null, null , null      

If the list is a dynamic, you'll have all to escape the strings and put them into a single quoted list.

Via:http://stackoverflow.com/questions/4707367/android-sqlite-in-not-in-syntax

Android Sqlite in, Syntax---not int (?)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.