WebSql Error


#1

can anyone explain me why this error is coming

Delete Query Error: could not prepare statement (23 not authorized)

instead of all insert update sql is working also delete sql is working in other function .

/* Reset Function */
	$scope.resetItem = function() {
		db.readTransaction(function (tx) {
			tx.executeSql("DELETE FROM TempCart", [], function(tx, results) {
				console.log ('ok');
			}, function(tx, error){
				console.log("Delete Query Error: " + error.message);
			});
		});
	}

#2

Hi,

Just try with this code :

$scope.resetItem = function() {
		db.transaction(function (tx) {
			tx.executeSql("DELETE FROM TempCart", [], function(tx, results) {
				console.log ('ok');
			}, function(tx, error){
				console.log("Delete Query Error: " + error.message);
			});
		});
	}

You can use ngDatabase instead of pure SQL syntax : https://github.com/abellion/ngDatabase