PURPOSE: The OSQL BUILD command is an automated application generator. This command will generate the OSQL commands necessary to construct the default application for this Data Base Library (DBL) and store the commands in an optional Command Module (CM) object.
For each table specified (TABLE table_name) or catalogued in the DBL (ALL TABLES), BUILD will create an OSQL INSERT, OSQL SELECT, and OSQL UPDATE command. The generic table maintenance screens which result from these commands are entered into a default table maintenance menu created by the OSQL BUILD command using the OSQL MENU command. Each table maintenance menu will then be entered into a main menu for this DBL.
OSQL BUILD FOR {TABLE \\table_name [,...]\\; ALL TABLES}
[DEFINE CM command_module_name [ONLY]]
TABLE \\table_name [,...]\\; ALL TABLES |
is the name of the table or tables which should be included in the application building process. Each table will have the necessary OSQL commands generated to provide for adding records to the table, displaying records in the table, modifying records in the table, and menu access to each of these functions. Note: Either the TABLE table_name or ALL TABLES clause must be chosen. If the ALL TABLES clause is chosen, all tables (up to 20) in the current DBL will be included in the BUILD process. |
DEFINE CM command_module_name |
specifies that the CM containing the code generated to execute the OSQL command be saved and named as an object in the current DBL. This CM is made up of OSQL commands which, when executed, will build the default application for this DBL. |
ONLY |
specifies that the CM will be created without being executed by OSQL. This clause is used primarily by the OSQL BUILD command but may also be used for on-line prototyping. If the ONLY clause is included, the CM may be invoked interactively or from another CM. |
*OSQL BUILD FOR ALL TABLES DEFINE CM BUILD_ORDERS_SYSTEM ONLY
USE CM BUILD_ORDERS_SYSTEM
NOTES: Each default screen will be assigned a name corresponding to the name of the table plus the name of the appropriate OSQL command. For example, the DS ORDERS table insert program will be named PM ORDERS_INSERT.
Only one Main Menu generated by OSQL BUILD is permitted per DBL. This menu is named after the current DBL plus the name "MAIN_MENU". For example, a DBL named ORDERS would have a Main Menu name of ORDERS_MAIN_MENU. Likewise, the Table Maintenance Menu associated with each table has a default name. Each Table Maintenance Menu is named after the Data Set (DS) or table name plus the name "TABLE_MENU". For example, a DS named PRODUCTS would have a Table Maintenance Menu name of PRODUCTS_TABLE_MENU.
The BUILD command will REMOVE any existing Process Modules (PM’s) with the specified names before the BUILD operation begins.
The BUILD command will have a total of three OSQL commands generated for it:
An OSQL INSERT command will produce a PM which is named after the table plus a suffix of "_INSERT". (See example below.)
An OSQL SELECT command will produce a PM which is named after the table plus a suffix of "_SELECT". (See example below.)
An OSQL UPDATE command will produce a PM which is named after the table plus a suffix of "_UPDATE". (See example below.)
For example, a DS named PRODUCTS will have default maintenance screens named PRODUCTS_INSERT, PRODUCTS_SELECT, PRODUCTS_UPDATE.
Simply list the three PM's to see the code generated for each. You may also want to modify it to customize it for your environment.