To use the sql.acu utility to create an empty table and grant access privileges to other users, type:
runcbl sql.acu
The program will pause to accept an SQL command. Type the following (italics indicate variable names, non-italics are SQL reserved words):
CREATE TABLE newtab (col1 CHAR(30), col2 CHAR(11)) <return>
The program will pause to accept an SQL command. Now type:
GRANT ALL PRIVILEGES ON newtab TO PUBLIC <return>
The program will pause to accept an SQL command. Now type:
CREATE UNIQUE INDEX newtab_index ON newtab (col1) <return>
Then press <return> again to exit the program. When naming columns and tables, make sure to use underscore (_), not hyphen (-), or a syntax error will result.
The above entries will create a new table and grant access permission to everyone. If you want to get rid of the table you created, type:
DROP TABLE newtab <return>
Usually, you would not do this as the COBOL output will perform similar functions. When run from the command line, maximum sql command is 80 characters.
The next topic teaches you how to call sql.acu from a program. Use the forward Browse button to move to the topic.