Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For fetching multiple row using curosor, Have a go with this, You could customize it for your need:</p> <pre><code>public List&lt;String&gt; getNotNullValues(String value) { String[] resultCols = new String[] { "Give your result column name here" }; //u could specify multiple column name here List&lt;String&gt; list = new ArrayList&lt;String&gt;(); int count = 0; Cursor cr = getWord("DATE", "Your Table Name", "Value of the column", resultCols,"!="); //Cr is the cursor for resulted query if (null == cr) { return null; } do { list.add(cr.getString(0)); //Fill the list or whatever here while traversing with the cursor } while (cr.moveToNext()); cr.close(); return list; } } public Cursor getWord(String columnName, String tblName, String rowId, String[] columns, String condition) { String selection = columnName + condition ; //condtion for selecting a value : "= ?" String[] selectionArgs = new String[] { rowId }; return query(selection, tblName, selectionArgs, columns); } </code></pre> <p>here are the steps:</p> <ol> <li>Form the query with condition, column name and required column name</li> <li>Get the cursor to the resulting query</li> <li>Move the cursor to the next record till cr.moveToNext() returns false</li> </ol> <p>For further reference:</p> <p>Complete Step by Step SQLite Example: <a href="http://mobile.tutsplus.com/tutorials/android/android-sqlite/" rel="nofollow">http://mobile.tutsplus.com/tutorials/android/android-sqlite/</a></p> <p>Youtube Video Tutorial</p> <p><a href="http://www.youtube.com/watch?v=kMaBTolOuGo" rel="nofollow">http://www.youtube.com/watch?v=kMaBTolOuGo</a></p> <p>Multiple Table Creation <a href="http://androidforbeginners.blogspot.com/2010/01/creating-multiple-sqlite-database.html" rel="nofollow">http://androidforbeginners.blogspot.com/2010/01/creating-multiple-sqlite-database.html</a></p> <p>PS: All the links are tested and working well!!</p> <p>Happy Coding!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload