Skip to content Skip to sidebar Skip to footer

Web Sql Drop/delete Table Not Working

I've tried several different commands for clearing my Web SQL Database and none of them work. Just to show you I've assembled all of them into one overkill function. What am I miss

Solution 1:

This worked for me

tx.executeSql("DROP TABLE foo",[], 
    function(tx,results){console.log("Successfully Dropped")},
    function(tx,error){console.log("Could not delete")}
);

Solution 2:

Worked for me:

tx.executeSql('DELETE FROM FormRecords');

Moreover, you cannot delete a Web SQL database.

Solution 3:

DELETE * FROM...

does not make sense. use DELETE FROM instead

Solution 4:

You last variant is correct. Just for testing you can open your web resourse by Chrome. Then open Resourses -> Web SQL where you can type DROP TABLE TABLENAME and check if everething is right.

Solution 5:

The follow code should works well:

var db = openDatabase(databaseName, "0.1", description, size)

var db.transaction(function (t) {
     t.executeSql("DROP TABLE objectTable",[], 
         function(t,results){
             console.error("Table Dropped")
         },
         function(t,error){
             console.error("Error: " + error.message)
         }
     )
})

Post a Comment for "Web Sql Drop/delete Table Not Working"