Sunday, 15 August 2010

sqlite3 - SQLite query in Android does not return correct values -


The following question does not return a price for the seller, even though it is in the database it gives a price for all other areas. , Except for the sale method.

  SELECT itemid, unitid, itemdesc, unitdescription, case? When 1 sell, 1 when the sales mark of 2, then the sales process 3, when selling 4, then 4 then the 5 end prices for the 5 items items WHERE COMPANYID =? By order ITEMDESC, UNITDESCRIPTION  

if I replace? With 2 and 7, then it gives the value of the sale

  SELECT itemid, unitid, itemdesc, unit description, case 2, 1, the sales process 1 then 2's selling process 2 when 3 sales process 3 then 4 When the Sales Process 4  

Here is how I execute the query

  cursor = dbContext.rawQuery (query, new string [] {integer .Testring (price level), integer.tosting (company id)});  

And here's how I cross the returned cursor.

  if (cursor.movatofst ()) {do {log.i ( "Item desc" cursor.getString (2)); Logs. I ("Sale", double.Toastring (cursor.gate double (4))); Items.add (new itemDisplay (cursor.getInet (0), cursor.gateINET (1), cursor.getstring (2), cursor.getstring (3), cursor.getdable (4))); } While (cursor.movetoonext ()); }  

Please help.

Thanks in advance. Resolve it It is known that RAQUQUERY uses only the parameters of its WHERE block.


No comments:

Post a Comment