Define() establishes specific data definitions. This involves defining columns/fields and creating the tables/files with optional indexes.
Below is the code for Define():
//
// Define()
//
// Create the table for containing a list of existing customers
//
function Defines($ses) {
print("\t<h4>DEFINE</h4>\n");
// create table
print("\t\tCreate table...<br>\n");
$qry = ctsql_query(
"CREATE TABLE custmast (
cm_custnumb CHAR(4),
cm_custzipc CHAR(9),
cm_custstat CHAR(2),
cm_custrtng CHAR(1),
cm_custname VARCHAR(47),
cm_custaddr VARCHAR(47),
cm_custcity VARCHAR(47))",
$ses);
if (!$qry)
Handle_Error("ctsql_query(CREATE TABLE)");
if (!ctsql_commit($ses))
Handle_Error("ctsql_commit()");
}