Android, sqlite database finding two values in the two columns and the resulting value -


improduct = "text">

im creates an Android application that uses a large pre-populated database of 910,000 records which include 4 columns . These columns are Windspeed, Latitude, Longitude and _id. What is trying to do is create a SQLite query, which has a single value in the latitude column and these two columns with long (longitude) values ​​and winds in the longitude.

The table will appear something like this:

_id .............. latitude ............. ..... longitude .... ......... Windspeed
1 .................- 9.486 9 363 .... ......... 61.3704805 ............. 7
2 .................- 7.6257292 ... ......... ..60.9958851 .............. 8
3 .....................- 9.486 9 363 ............ 60.9958851 .............. 10

So if I use the above table I have to find out - 9 486 9 363 and long value will be 60.9958851 and thus will be Windspined line which meets both table row 3 and thus wind speed is 10

Trying to use this line of code to do this, but I think this is not correct

  public class MyDatabase Extended SQLiteAssetHelper {Private Static Last string DATABASE_NAME = "Wind speed.sqlite"; Personal Static FINAL END DATABASE_VERSION = 1; Private static final string LAT_VAL = "latitude"; Private Stable Last String LONG_VAL = "Longitude"; Private Stable Last String WIND_SPEED = "Speed ​​10m"; Private static final string ROW_ID = "_id"; Double lait = 3.52; Double long = 65.42; Public MadeBasebase (Reference Reference) {Super (Reference, DatabaseNNAn, Blank, Databasebysons); } Public cursor getWindSpeed2 () {SQLiteDatabase db = getReadableDatabase (); SQLiteQueryBuilder qb = New SQLiteQueryBuilder (); String [] sqlSelect = {WIND_SPEED,}; String sqlTables = "noabl_10m_out"; Where string string = "LAT_VAL =? And LONG_VAL =?"; String [] where ARG = new string [] {"lat", "long"}; Qb.setTables (sqlTables); Cursor D = qb.query (Select DB, sql, whereclose, wherears, blank, empty, empty); D.moveToFirst (); Return D; }}   

Is it wrong, I've discovered ive and air and I just want to stay confused so thank you so much for any help.

It seems that you are not using column names, but rather the variable names.

Try changing from where to call:

  string where clause = LAT_VAL + "=? And" + LONG_VAL + "=?";   

Also where to:

  string [] whereArgs = new string [] {String.valueOf (lat), String.valueOf (Long )};   

There are many mistakes in your code and I'm not sure that you do not know what you're doing .. Here's an unnecessary comma:

  string [ ] SqlSelect = {WIND_SPEED,};    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -