MYSQL.drop_table (tablename)
This method of the MYSQL class causes a table to be deleted from the database. All rows in the table will also be deleted. This method is equivalent to MYSQL.query("DROP TABLE tablename").
This method is defined in the Gamma library /usr/cogent/require/MySQLSupport.g. It is made available to a Gamma program with the statement: require("MySQLSupport");.
This example is taken from Section 2.2, “Tutorial 2: create_pets.g”
... /* Remove any previously-created table called "pets" This is essentially the same as issuing the command: mysql.query("DROP TABLE IF EXISTS pets");*/ try mysql.drop_table ("pets"); catch; /* Create the "pets" table, and add columns to it. */ mysql.create_table("pets"); ...
The try/catch statement allows the processor to continue even if there is an error.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.