Data Access Getting Started > Additional Features > Creating the Employee Manager Window > Defining the EMPMGR_DS SQL Data Source
 
Defining the EMPMGR_DS SQL Data Source
To define the EMPMGR_DS SQL data source, do the following:
1. Choose New > Gadgets from the File menu.
A new gadgets buffer is opened ready for you to edit.
Note: If your employee.ilv buffer is still open, minimize it in the Main Window.
2. Define the EMPMGR_DS data source like you did for the EMP_DS data source Defining the EMP_DS SQL Data Source on page 58.
*Type the name EMPMGR_DS in the Name field of the SQL Data Source inspector.
*In this case, you need to add both the I_EMP and I_DEPT tables to the data source. Select Add Tables... from the Query menu of the SQL Data Source inspector. When the Select Tables panel appears, select each table in the left list and move it to the right list by clicking the -> button. When both tables appear in the right list, click OK and then Close.
3. Click the Select page of the SQL Data Source inspector. From the I_EMP table, add the EMPNO and NAME columns (but not the DEPTNO, STATUS nor SALARY columns) to the EMPMGR_DS data source by dragging lines from the tables in the FROM section to the SELECT section.
4. From the I_DEPT table, drag lines to add the NAME and MANAGER columns (but not the DEPTNO column). The EMPMGR_DS SQL Data Source inspector now looks like this:
5. Choose Properties from the File menu of the SQL Data Source inspector. Ensure that the Updatable Table property is set to I_EMP.
Note: By default, only the first table added to a data source can be updated. In the FROM section of the SQL Data Source inspector, the title of the table that can be updated is shown in bold font. You can change which tables can be updated by double-clicking on each table title and changing the “Updatable” check box according to your needs.
6. Click Apply in the SQL Data Source inspector.
EMPMGR_DS appears under the data source icon in the Main window.

Version 6.0
Copyright © 2015, Rogue Wave Software, Inc. All Rights Reserved.