Importing a DDL File and Modifying the Database Schema

You can import tables, views and other database objects such as constraints, triggers and indexes using DDL. The DDL file should contain all tables available in the database schema.

Prerequisites

You have loaded the DB-specific profile and logged-in with the Information Architect role.

Context

You want to import the database schema of a relational database using DDL in order to create a database schema in the target package or to update or enhance an existing database model on the basis of it.

You can choose between:

  • Standard Import

    You can make a specific selection of the database elements to be imported

  • Advanced import

    You open the DB manager, which provides advanced comparison and import functions

Note

An expression is assigned to precisely one viewpoint when importing a DDL file which contains a view with a * expression for view columns.

Examples:

CREATE VIEW v1 AS SELECT * FROM t1; results in a view column * with the expression *.

CREATE VIEW v2 (a,b,c) AS SELECT * FROM t2; results in three view columns "a", "b" and "c"; "a" has the expression *.

How to proceed

  1. In the model, select the database schema that you want to import.

  2. Select Import/Export>Import>DDL File.

    The DDL Import Wizard for selecting the file to be imported appears.

  3. To select a DDL file, click on .

    The Open dialog appears.

  4. Select the DDL file and confirm with Open.

    The DDL file's path is shown.

  5. In the model, select the target package into which you want to import the tables of the DDL file and click on Next.

    The wizard jumps to the next step. All database objects available for import in the DDL file are displayed in the wizard.

  6. To select the database objects that you want to import from the DDL file, activate the relevant check boxes and click on Next.

  7. To select the import variant, click on the relevant button. The wizard jumps to the next processing step or to the DB Manager editor.

  8. If you chose the Standard Import, you select the database elements that you want to import into the target package in the next step.

    To import the selected database elements, click on Import.

    The selected database elements are imported into the target package and displayed in the DB Manager editor.

    You can see information and errors issued during the import in the Details tool window. Read these through to see what the import has created and problems that may have occurred throughout the import.

  9. If you chose Advanced Import, the selected tables and views are displayed along with the target package in the DB Manager editor.

    Use the Database Connection>Import>Change Database Schema or ...>Complete Database Schema commands for the import.

    Use the Change Database Schema command to update the database elements selected on the left-hand side in the data model on the right-hand side. Existing database elements are overwritten and new database elements are added.

    Use the Complete Database Schema command to add the database elements selected on the left-hand side in the data model on the right-hand side. Existing database tables are not overwritten. New database elements are added.

  10. If you are still not happy with the results, then you can undo all import changes by selecting Undo (Ctrl+Z).

    If you are unable to undo the changes, then you can delete the imported elements in the Result Region.

    If the elements are not in the Result Region, then you can easily find the imported elements in the Find dialog in the Find Date tab.