4

I am running a WebSql query that contains an error; When i console.log(error) I get the following error message

could not execute statement (20 datatype mismatch)
  1. What i need to know is what is that 20 in front of the message.
  2. How do I know on which field the error has occured?

here is the complete log of the error

SQLError {message: "could not execute statement (20 datatype mismatch)", code: 1, UNKNOWN_ERR: 0, DATABASE_ERR: 1, VERSION_ERR: 2, CONSTRAINT_ERR: 6DATABASE_ERR: 1, QUOTA_ERR: 4, SYNTAX_ERR: 5, TIMEOUT_ERR: 7, TOO_LARGE_ERR: 3, UNKNOWN_ERR: 0}
paishin
  • 258
  • 1
  • 5
  • 15

1 Answers1

3

I'm not an expert on HTML5 + SQLLite, but I'm running into the same issue as you. Error code 20 is a mismatch/conflict. (See here: https://www.sqlite.org/c3ref/c_abort.html) You must be calling an insert or update statement where the Javascript variable you think is ok, is actually not compatible with your table schema. e.g. you defined an INTEGER and are inserting a String/VARCHAR. I can image it's a pain with Javascript not being variable type strong.

dubmojo
  • 6,660
  • 8
  • 41
  • 68