Jolin
Jolin

Reputation: 1615

will the string value match the integer value in sqlitedatabase?

I have the query as following, the DbEntry.COLUMN_NAME_SCENE_ID is a integer type. will a string "123" match with the integer 123 in the sqlitedatabase?

db.query(DbEntry.TABLE_NAME, new String[]{DbEntry.COLUMN_NAME_MODEL_PATH}, DbEntry.COLUMN_NAME_SCENE_ID+"=?", new String[]{String.valueof(scene_id)}, null, null, null);

Upvotes: 0

Views: 108

Answers (1)

janos
janos

Reputation: 124844

It will work. SQLite is very lax with respect to types. For example you can fire up an SQLite client and connect to an SQLite database and run a query on a table with an integer field using a WHERE clause with a string value. It will work just fine.

Upvotes: 1

Related Questions