VisualAge Generator supports various file access methods and databases, including IBM's implementation of relational databases. In this section of the tutorial, you define the SQL record for the CUSTOMER sample table.
You define all records in the Record Editor, which you have easy access to from the Program Editor.
To begin defining the SQL record:
This section of the structure diagram is expanded.
The New Part Package/Application window is displayed.
Note: | You'll find the record type drop-down list box between the tool bar buttons and the Default Usage drop-down list box. The default record type is Working Storage. |
The SQL Row Properties window is displayed.
When you define an SQL row record, you specify the SQL table or table joins for the record. In this tutorial, VisualAge Generator Developer uses the CUSTOMER table from the SAMPLE database you specified in VAGen Options/Preferences.
Once the SQL table or table join has been specified, VisualAge Generator Developer can automatically build data item names and characteristics by retrieving the column information for the table or join. This function is only available if you are on a system that has access to the database catalog.
To finish defining an SQL table:
The SQL Row Properties window closes.
Data items based on the SQL table column characteristics are created and inserted into the SQL row record.
Note: | If Retrieve SQL is not available, delete any data items that appear in the record. |
Tip: | Before you can save a record, you must press the tab key to move the cursor out of the changed field. |
Note: | If you have problems with the previous task, refer to the section on installing sample applications in the VisualAge Generator Installation Guide. |
In the SQL row record, VisualAge Generator Developer creates data items that have the characteristics of the columns in the table.
Because you can retrieve SQL column information directly from any supported relational database, you do not have to supply data item characteristics. This saves you time and minimizes errors.