mercredi 6 avril 2016

Why selection arguments only apply to the where clause in RawQuery?

Why selection arguments only apply to the where clause in RawQuery and not, for example in the from clause?

I'm asking this because in the "from clause" you might have the same things as in the "where clause", for example when using joins.

SELECT table1.field_x, table2.field_y FROM table1
LEFT OUTER JOIN table2 ON table1.field_x = table2.field_z AND table2.language =?
WHERE table1.language=?

I would like to make a Rawquery like this:

RawQuery("SELECT table1.field_x, table2.field_y FROM table1
LEFT OUTER JOIN table2 ON table1.field_x = table2.field_z AND table2.language =?
WHERE table1.language=?",
new String[] {language, language}

It doesn't give a semantic error, nor a compilation error, but it's not working at execution time.

Aucun commentaire:

Enregistrer un commentaire