Example

CREATE TABLE STAFF(ID INTEGER NOT NULL,
             NAME VARCHAR(10) NOT NULL, DEPT INTEGER NOT NULL,
             JOB VARCHAR(6) NOT NULL, YEARS INTEGER,
             SALARY FLOAT(8,2) NOT NULL,COMM FLOAT(8,2))

AcuXDBC supports the creation of permanent base tables only. Tables contain one or more columns separated by commas, which must also be defined when you create the table. The query processor will store Data Definition Language (DDL) statements after a CREATE TABLE statement until the first non-DDL statement is encountered. It will then create the COBOL table.

Example:

SQL (/? for help) ==> CREATE TABLE staff (
SQL continued ======>     id INTEGER NOT NULL,
SQL continued ======>     name VARCHAR(10) NOT NULL,
SQL continued ======>     dept INTEGER NOT NULL,
SQL continued ======>     job VARCHAR(6) NOT NULL,
SQL continued ======>     years INTEGER
SQL continued ======> );
SQL (/? for help) ==> CREATE UNIQUE INDEX
SQL continued ======>     i_staff0
SQL continued ======> ON
SQL continued ======>     staff( id )
SQL continued ======> ;
SQL (/? for help) ==> INSERT INTO
SQL continued ======>     staff
SQL continued ======> VALUES (
SQL continued ======>   1, 'John Smith', 31, 'PGM', 1
SQL continued ======> );

After the insert, the table will be created in the first directory listed in your FILE_PREFIX configuration file variable. Here is the file description:

C:\>vutil32 -info -x SYSTEM%STAFF (vision version 5) 
 
        # of records                     :   1 
        # of deleted records             :   0(0+0) 
        file size                        :   1024 (SYSTEM%STAFF) 
        file size                        :   1024 (SYSTEM%STAFF.vix) 
        total file size                  :   2048 
        segment size                     :   2147482112 
        record size                      :   34 
        # of keys                        :   1 
        key size                         :   6 
        key offset			                       :   0 
        duplicates okay                  :   N 
   
        block size                       :   512 
        blocks per granule               :   1 
        tree height                      :   1/1/1.0 
        # of nodes	                       :   1 
        # of deleted nodes               :   0 
        total node space                 :   509 
        node space used                  :   24 (4.72%) 
        user count                       :   0