Unable to delete columns from SQLite table [android]

Since I can’t comment here: How do I delete column from sqlite table in android?

The method I did doesn’t work at all, the column is still Exist. This is my SQL:

db.execSQL("CREATE TEMPORARY TABLE Evaluation_backup(" + allColumnName + ");" 
+ "INSERT INTO Evaluation_backup SELECT "+ allColumnName +" FROM Evaluation;"
+ "DROP TABLE Evaluation;"
+ "CREATE TABLE Evaluation("+ allColumnName + ");"
+ "INSERT INTO Evaluation SELECT "+ allColumnName + "FROM Evaluation_backup;"
+ "DROP TABLE Evaluation_backup;");

allColumnName is String containing all column names except the name of the column to be deleted. The contents of allColumnName are as follows: column1, column2,column3.

Thanks in advance.

documentation for execSql Say:

Execute a single SQL statement …

Call db once for each statement .execSql.

Because I can’t comment here: How do I delete column from sqlite table in android?

The method I did does not work at all, the column still exists. This is my SQL:

db.execSQL("CREATE TEMPORARY TABLE Evaluation_backup(" + allColumnName + ");" 
+ "INSERT INTO Evaluation_backup SELECT "+ allColumnName +" FROM Evaluation;"
+ "DROP TABLE Evaluation;" < br /> + "CREATE TABLE Evaluation("+ allColumnName + ");"
+ "INSERT INTO Evaluation SELECT "+ allColumnName +" FROM Evaluation_backup;"
+ "DROP TABLE Evaluation_backup;");< /pre>

allColumnName is String containing all column names except the name of the column to be deleted. The content of allColumnName is as follows: column1,column2,column3.

Thanks in advance.

documentation for execSql says:

Execute a single SQL statement …< /p>

Call db.execSql once for each statement.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 949 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.