1.4.13.6 Dropping Tables

Warning: Dropping a table in SQL means removing the table from the database and therefore losing all the data it contained.

To drop (or remove) a table in SQL you would use the following command:

DROP TABLE table_name

For example:

DROP TABLE Person

To drop the table above using a web.database cursor we would use the following code:

cursor.drop('Person')

The drop() method of a web.database cursor looks like this:

drop( table[, execute] )
Remove a table
table
A string containing the name of the table to drop.
execute
If False the method returns the SQL string to perform the desired operations. If True the SQL is executed. If not specified takes the value specified in the cursor which by default is True