MYSQL.create_table (tablename)
This method of the MYSQL class creates a new table with a single column, named "id" as an auto-incrementing integer primary key. To add more columns to the table, use the MYSQL.add_column method.
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”
... /* Create the "pets" table, and add columns to it. */ mysql.create_table("pets"); mysql.add_column ("pets", "name", "VARCHAR(20)", nil, nil); mysql.add_column ("pets", "owner", "VARCHAR(20)", nil, nil); ...
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.