FUNCTION MakeTable_CUSTOMERS
***** Table setup for CUSTOMERS *****
CREATE TABLE 'CUSTOMERS.DBF' NAME 'CUSTOMERS' (CUSTOMERID C(5) NOT NULL, ;
COMPANYNAME C(40) NOT NULL, ;
CONTACTNAME C(30) NULL, ;
CONTACTTITLE C(30) NULL, ;
ADDRESS C(60) NULL, ;
CITY C(15) NULL, ;
REGION C(15) NULL, ;
POSTALCODE C(10) NULL, ;
COUNTRY C(15) NULL, ;
PHONE C(24) NULL, ;
FAX C(24) NULL)
***** Create each index for CUSTOMERS *****
ALTER TABLE 'CUSTOMERS' ADD PRIMARY KEY CUSTOMERID TAG CUSTOMERID COLLATE 'MACHINE'
INDEX ON UPPER(COMPANYNAME) TAG COMPANYNAM COLLATE 'MACHINE'
INDEX ON UPPER(CITY) TAG CITY COLLATE 'MACHINE'
INDEX ON UPPER(POSTALCODE) TAG POSTALCODE COLLATE 'MACHINE'
INDEX ON UPPER(REGION) TAG REGION COLLATE 'MACHINE'
***** Change properties for CUSTOMERS *****
DBSETPROP('CUSTOMERS.CUSTOMERID', 'Field', 'Caption', "Customer ID")
DBSETPROP('CUSTOMERS.CUSTOMERID', 'Field', 'Comment', "Unique five-character code based on customer name.")
DBSETPROP('CUSTOMERS.CUSTOMERID', 'Field', 'InputMask', "XXXXX")
DBSETPROP('CUSTOMERS.CUSTOMERID', 'Field', 'Format', "!A")
DBSETPROP('CUSTOMERS.COMPANYNAME', 'Field', 'Caption', "Company Name")
DBSETPROP('CUSTOMERS.CONTACTNAME', 'Field', 'Caption', "Contact Name")
DBSETPROP('CUSTOMERS.CONTACTTITLE', 'Field', 'Caption', "Contact Title")
DBSETPROP('CUSTOMERS.ADDRESS', 'Field', 'Caption', "Address")
DBSETPROP('CUSTOMERS.ADDRESS', 'Field', 'Comment', "Street or post-office box.")
DBSETPROP('CUSTOMERS.CITY', 'Field', 'Caption', "City")
DBSETPROP('CUSTOMERS.REGION', 'Field', 'Caption', "Region")
DBSETPROP('CUSTOMERS.REGION', 'Field', 'Comment', "State or province.")
DBSETPROP('CUSTOMERS.POSTALCODE', 'Field', 'Caption', "Postal Code")
DBSETPROP('CUSTOMERS.COUNTRY', 'Field', 'Caption', "Country")
DBSETPROP('CUSTOMERS.PHONE', 'Field', 'Caption', "Phone")
DBSETPROP('CUSTOMERS.PHONE', 'Field', 'Comment', "Phone number includes country code or area code.")
DBSETPROP('CUSTOMERS.FAX', 'Field', 'Caption', "Fax")
DBSETPROP('CUSTOMERS.FAX', 'Field', 'Comment', "Phone number includes country code or area code.")
CREATE TRIGGER ON 'CUSTOMERS' FOR DELETE AS __ri_delete_customers()
CREATE TRIGGER ON 'CUSTOMERS' FOR UPDATE AS __ri_update_customers()
ENDFUNC