java.lang.IllegalArgumentException: Can not bind the argument to index 0 because the index is out of range. The declaration has 4 parameters

advertisements

Android SQLLite gives me the following error:

 SQLiteStatement tgStatement = dbo.compileStatement("INSERT OR REPLACE INTO Game_Team" +
                "(teamId, gameId, pos, score) VALUES (?,?,?,?) ");

Thats why I try to do:

tgStatement.bindLong(0, 1);

I get an error

java.lang.IllegalArgumentException: Cannot bind argument at index 0 because the index is out of range.

The statement has 4 parameters.

So, my question is, if there are 4 parameters, why is it complaining about argument at index 0? how is that out of range?


The parameters are 1-indexed. The index needs to run from 1 to 4, so 0 is out of range.