Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Android Sqlite
Hi All,
 
I want to write a query like this:
SELECT Name from DEPT where number == number and Name == Name
 
I wrote a similar query in SQLite but this does not work:
 
Cursor c=db.query(viewDepts, columns, deptnumber + deptName+"=?", new String[]{number, Time}, null, null, null);
 
Need Help ASAP.
 
Thanks,
Jason
Posted 19-Apr-11 18:28pm
Edited 23-Apr-11 19:48pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Take a look at the query [^] and rawQuery [^] documentation. The query methods and the parameter details are listed. You can alternatively also use the rawQuery method, you can pass the sql statement to it with the selection arguments.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Check out the following link.....
http://mindstick.com/Articles/2643e627-4f5c-45cc-b166-9a9b4c9ff3b1/?Select%20query%20in%20Android%20Application
 
It will help more to understand about 'select query in android application' or android sqlite database.
 
Thanks Everyone!!
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

check the below link. that will help you to get a better idea about sqlite select and other database operations.
sqlite database operations[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 319
2 CPallini 275
3 DamithSL 214
4 Maciej Los 185
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 3 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100