Question

I'm trying to run the following Web SQL query in a Phonegap application:

db.transaction( function(tx) { 
    tx.executeSql('SELECT * FROM EVENT,RESPONSE WHERE EVENT.event_id=RESPONSE.event_id AND EVENT.event_id=291 AND EVENT.persona_id=3', [], function(tx, results) { 
        console.log(results);
        window.results = results;
    }, function(err) {
        console.log(err);
    }); 
});

In Chrome, Android Browser & iOS this works fine, but in some cases within the compiled PhoneGap Android app it doesn't, returning 0 rows.

I've done some debugging by simplifying the query and the following work:

SELECT * FROM EVENT WHERE event_id=291 AND persona_id=3

SELECT * FROM RESPONSE WHERE event_id=291

It seems to be the WHERE / JOIN parts of the query that are bugging out, but I can't seem to isolate why this would only be happening in the Android PhoneGap inline web view and nowhere else.

Is anyone aware of any differences in the web view that might be causing this, or come across something similar?

Was it helpful?

Solution

I've seen similar data truncation behaviour before, but not related to joins. How big is your webSQL database? Check the size value of your window.openDatabase() command, it may be too small for your database.

window.openDatabase(name, version, display_name, size);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top