expo-sqlite not replacing placeholders. getting Error: near "?": syntax error

Please provide the following:

  1. SDK Version: 45
  2. Platforms: Android

I am getting an error on android that says: “Error: near “?”: syntax error (code 1 SQLITE_ERROR):”. I tried to use the db.exec method passing the Query type and also with transaction and then tx.executeSql. What might be the cause that sqlite on my expo app does not seem to replace placeholders?

Hi @rafaelri

Could you post some example code?

Hi @wodin I just discovered why SQLite Placeholders for Table Names

Ah yes, I had a suspicion. That’s unfortunately how all database drivers do parameter substitution as far as I know. They only allow you to do it on stuff in the WHERE clauses. Not for things like table names.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.