Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70894

Cordova SQLite - please help with error output

$
0
0

@elduderino15 wrote:

Can somebody please explain me the error message my ionic / cordova app is returning when writing to an already open SQLite DB?

A READ request before the write to the DB fine, but writing fails...

[Log] {"db":{"openargs":{"name":"mydb.db","dblocation":"docs"},"dbname":"mydb.db"},"txlock":true,"readOnly":false,"executes":[],"finalized":true} (console-via-logger.js, line 174)

This is what SQLite outputs before I run the write transaction:

[Log] OPEN database: mydb.db (console-via-logger.js, line 174)
[Log] new transaction is waiting for open operation (console-via-logger.js, line 174)
[Log] DB opened: mydb.db (console-via-logger.js, line 174)

That's how I write to it

myDB.transaction(function(transaction) {
             var query = "UPDATE Data SET Values='"+dataJSON+"'";
//           console.log(query);
             transaction.executeSql(query,[],
             //On Success
             function(tx, result) {
//               console.log('UPDATE SUCCESSFULLY');
                 deferred.resolve(true);
             },
             //On Error
             function(error){
//               console.log('Backing up data to DB failed');
                 deferred.reject(error);
             });
    });

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>