Mark Bowen6778362
Posts: 0
Joined: Tue Apr 01, 2014 9:30 pm

Transfer JSON from ACL column of database into SQLite

Hi

I am trying to transfer the contents of the acl column from my database into a SQLite database to use for local storage

I have used the tutorial and it is working for every column except the acl one. I have defined the entry in my SQLite database as TEXT - and when they didn't work tried as BLOB

When I examine the console it just returns (undefined) - the ACL does contain text

This is the code (from the tutorial)

var db = window.openDatabase("practices", "", "practices", 1024*1000);

db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS "Tables" (objectId TEXT, practice TEXT, address1 TEXT, address2 TEXT, city TEXT, postcode TEXT, country TEXT, telephone TEXT, pemail TEXT, website TEXT, consent TEXT, icon TEXT, permissions BLOB)', []);
tx.executeSql('SELECT * FROM "Tables" WHERE "objectId" = "' + value.id + '"', [], function(tx, results){
if (results.rows.length === 0){
tx.executeSql('INSERT INTO "Tables" (objectId, practice, address1, address2, city, postcode, country, telephone, pemail, website, consent, icon, permissions) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)', [value._id, value.Practice, value.Address1, value.Address2, value.City, value.Postcode, value.Country, value.pTelephone, value.pemail, value.website, value.consent, value.Logo, value.permissions]);
}
});
});

return;

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Transfer JSON from ACL column of database into SQLite

Hello!

Where in your code you call to acl field?

Mark Bowen6778362
Posts: 0
Joined: Tue Apr 01, 2014 9:30 pm

Transfer JSON from ACL column of database into SQLite

Oh yes! Thank you.... its been a long week.

Return to “Issues”