From a table or view

About this task

When you generate a type tree for a table or view, information from your database and from the Database Interface Designer is used to create a type tree file (MTT). If you change your database table definition or edit the database definition in the Database Interface Designer, you must generate a new type tree to reflect the new information.

Generated type trees may differ when generated using different database adapters. For example, a date field may be represented differently by different databases. For this reason, use the same adapter type that will be used at run time to generate the type tree with the Database Interface Designer. Or, if you use ODBC, use the Column Attributes Override dialog that is described in the Resource Adapters documentation.

To define the type tree to generate from a table or view, use the Generate Type Tree from Tables dialog or the Generate Type Tree from Views dialog. The following table contains fields and descriptions.

Database Name This is the name of the database from which you want to generate a type tree. (This name is automatically inserted based upon your selection in the Navigator.)
Tables/Views This list displays all of the tables, views, or synonyms that have been defined in this database. Select one or more from this list.
Note: If the table, view, or synonym you want is not displayed in this list, add it by right-clicking in the list, selecting Insert, and typing the desired name.
File name This field displays a system-generated file name based upon the database selection in the Navigator. The default value is the database name with a type tree extension (MTT) and a default path.

To change any of this information, click the browse button.

Overwrite file This check box determines whether you want to replace the existing type tree file (MTT) upon saving it. The default value is disabled.
Override type This check box determines whether to replace existing types with matching, newly generated types and to add any non-matching new types to the type tree file (MTT). This is useful when you want to add types for additional tables into an existing type tree. The default value is enabled.
Row group format This list displays options to determine the row format in the generated type tree. The default value is Delimited.
Option
Description
Delimited
Select this option to create rows delimited with a pipe character (|) or some other user-defined selection. This is the preferred option if you are using large column widths where the values may be smaller than the width of the columns. The pipe character is the default selection.
Fixed
Select this option to create rows of fixed size in the generated type tree. There are certain situations in which you would want to select Fixed:
  • The query result contains a large number of rows where each row consists of small, fixed-length fields. In this situation, delimiters are unnecessary and they also consume memory.
  • You need to append fields in the output. This may be true if multiple fields have some meaning when concatenated together.
Delimiter This is the value for the delimiter to be used when generating this type tree. For a list of available symbols, click the browse button. The Symbols dialog appears, allowing you to select the desired value. The default value is a pipe character (|).
Terminator This is the value for the terminator to be used when generating this type tree. For a list of available symbols, click the browse button. The Symbols dialog appears, allowing you to select the desired value. The default value is <CR><LF >.
Release This is the value for the release character to be used when generating this type tree. For a list of available symbols, click the browse button. The Symbols dialog appears, allowing you to select the desired value. The default value is an exclamation point (!).
Override Column Definitions (For ODBC only) This check box indicates whether the database driver (with check box disabled) or a command line override (with check box enabled) is used to interpret columns. The default value is disabled.

For more information about this field, see the adapter-specific documentation in each adapter reference guide.

Generate type trees in 1.4.0 format (For Oracle adapter only) This check box determines whether you can generate type trees that are compatible with maps for Version 1.4.0. You might enable this functionality if you have legacy 1.4.0 maps that you want to maintain for some reason. The default value is disabled.

For more information about this field, refer to adapter-specific documentation in each adapter reference guide.

Represent date/time columns as text items

If you are generating new type trees, make sure this check box is disabled. The default is disabled.

Because of adapter-specific differences in date and time formats, see the adapter-specific instructions in each adapter reference guide.

Treat text item as This list displays the languages available in which to handle text items. The default value is Western.

To generate a type tree from a table or view:

Procedure

  1. In the Navigator, highlight the icon of the database containing the table from which you want to generate a type tree.
  2. From the Database menu, select Generate Tree From > Table.

    or

    In the Navigator, right-click the database icon and select Generate Tree From > Table.

    The Generate Type Tree from Tables dialog appears, including a list of tables and views.
  3. If you need to add a table because it is not displayed in the Tables/Views list, you must insert it using the instructions provided in the Note below.

    or

    If you see one or more tables in the Tables/Views list that you want to select, if it is one; select it. If it is multiple tables, press either Shift or Ctrl and click the desired table.

    If the table or view you want is not displayed in this list, add it by right-clicking in the list, selecting Insert, and typing the desired name.

  4. To create a new type tree, in the File name field, specify the path and name (with an .mtt extension).

    or

    Click the browse button to select a type tree from the Save As dialog. Highlight it and click OK.

  5. Specify the remaining options as desired. Refer to context-sensitive help for field-specific information.
  6. Click Generate.
    The Database Interface Designer and the Type Tree Maker produce a type tree corresponding to the selected database table(s) or view(s).

Results

The generated type tree is represented in the Navigator with the table/view icon next to the name.