Note that there are some explanatory texts on larger screens.

plurals
  1. POPhonegap SQL throws error but succeeds anyway
    primarykey
    data
    text
    <p>I'm currently using Phonegap 2.0 and running a sql transaction on my app. When the app starts, I have the following code (edited to protect the hinds of certain programmers)</p> <pre><code>document.addEventListener("deviceready", onDeviceReady, false); var db; function onDeviceReady() { db = window.openDatabase('gophersspots','1.0','Gophers Spots',200000); db.transaction(function(tx){ tx.executeSql('CREATE TABLE IF NOT EXISTS search_history (searchval_what VARCHAR (500), searchval_where VARCHAR (500), date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)'); }; }; </code></pre> <p>And in my pagebeforechange code for one of my pages, I have the following transaction:</p> <pre><code>db.transaction(function(tx){ tx.executeSql('SELECT * FROM gophers_search_history ORDER BY date DESC', [], function(tx,results){ //Do some code here....let's call is Success A. },function(err){ alert("Error processing get search SQL: "+err); console.log(err.code); console.log(err.message); },function(){ //alert("Database SQL query successful!"); }) </code></pre> <p>Now here's the bizarre thing. When I run this query, the error message pops up. The code I'm getting is 0, and the message is the statement callback raised an exception or statement error callback did not return false</p> <p>But the success function runs too! Success function A runs, and it has results, and everything works just fine. Am I missing something?</p> <p>Not sure if this is relevant, but I recently moved up from Phonegap/Cordova 1.7.0 to 2.0.0. I've yet to check the documentation to see if there was a change in syntax, which is going to be my next step. Just wanted to check if anyone here had the issue as well?</p> <p>May the person who solves this for me mysteriously inherit a beer factory and a lifetime strip club membership. Amen.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload