As an easy to use example, LANSA ships a table definition in its internal database.
1. Open the IDE and select the Tools ribbon:
2. Click the Import Table Definitions button to begin the import process:
The initial dialog lists available DSN sources.
3. If you are importing from your own database and need to create a DSN entry, select the New Data Source (highlighted) and click Next. You can then define the new Data Source and test the connection:
4. You will import the table definitions for table XVENDOR which is in scheme XLANSA. This table already has a System Data Source Name entry (DSN).
Scroll down to Locate the DSN for your Visual LANSA database. This has the same name as your Visual LANSA install folder. Select the Data Source Name and click Next:
5. The next dialog lists schema names for this database. Expand the XLANSA schema and select table XVENDOR. Then click Next:
6. On the Options dialog, leave the check boxes unchecked and click Next:
7. A message box is displayed briefly, while the table definition is imported to the Repository. The new table is then shown on the next panel. Expand XVENDOR to see the information that has been added to the Repository. Click Finish.
8. Select the Repository tab. Expand Tables to locate your new table XVENDOR. Note that it has a blue icon because it is an imported table definition. Expand the table definition to see its columns and Indexes.
9. Use the context menu on table XVENDOR to compile it:
10. You can leave the Compile Options as shown. The option Compile only if necessary applied to a new imported table definition will generate and compile its OAM (Object Access Module).
11. The compile log is shown on the Compile tab. The table is now ready to be accessed by Visual LANSA applications.
12. To import another table from one of your databases, ensure that the database is accessible from your PC, then follow this procedure from Step 1.
Note: An imported table definition is normally part of an existing non-LANSA application. Its definition is maintained outside of Visual LANSA. If changes occur, such as a new index or additional columns, the table definition must be re-imported into the Visual LANSA Repository.