Hi all,
I've got this piece of code where I count words in a dictionary and
then I try to query them:
String params[] = { Integer.toString(minlength),
Integer.toString(maxlength) };
SQLiteStatement statement = database
.compileStatement("select count (1) from (" +
SELECT_BY_LENGTH
+ ")");
statement.bindLong(1, minlength);
statement.bindLong(2, maxlength);
// statement.execute();
int count = (int) statement.simpleQueryForLong();
statement.close();
Cursor cursor;
cursor = database.rawQuery(SELECT_BY_LENGTH, params);
if (cursor.move(1)) {
The SELECT_BY_LENGTH is defined this way:
private static final String SELECT_BY_LENGTH = "select word._id,
word.word from word where length(word.word) between ? and ? ";
And the count works perfectly but the cursor.move(1) always returns
false. I've tried to get the column count and responds with the
correct count and the column names map too. I mean that the method
getColumnIndex works too but I can't get any data from the cursor. All
such methods fail. Am I doin' something wrong??
I'm using android 1.5.
Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---