varholl
varholl

Reputation: 331

SQLite and Windows Metro, Correct Query not returning data

I'm having a weird problem,

I'm using SQLite on windows 8 application, everything works fine... except for one query.

I'm using the same method for 4 different querys (all of them return the same columns), the mapping is correct since at least one of them is working.

The problem is... the query returns no results, if I copy my sql statement and run it into sqlite mannually, it works and returns 14 rows...

my sql statement is: "select w1.word_sense, w2.word from word_senses as w1, word_senses as w2 where w1.equiv_word = 'A' and w1.ID = w2.ID and w1.word_sense != w2.word_sense and w2.usage & 66294!= 0 and w2.usage &3072= 0 order by w1.word_sense, w2.word"

the line of code that executes the query is:

List synonyms = await DBHelper.Instance.QueryAsync(sql);

the mapping is:

public class WordSynonymMapping
{
    [SQLite.Column("word_sense")]
    public int WordSense { get; set; }

    [SQLite.Column("word")]
    public string Word { get; set; }
}

I can't find a solution...

Here is a copy of a statement that actually works...

"select w1.word_sense, e.example as word from word_senses w1 ,examples e where w1.equiv_word = 'A' and w1.usage & 0 = 0 and e.word_sense = w1.word_sense order by w1.word_sense, e.example"

can anybody help me with this? I'm stucked and don't know how to proceed.

Thanks!

Upvotes: 2

Views: 369

Answers (1)

varholl
varholl

Reputation: 331

Just for anyone else with the same problem... my database had some indexes missing, appareantly without those indexes the queries were taking up to 2 seconds... and SQLite returns empty when it takes that much time.

Upvotes: 1

Related Questions