Use the Built-in Query Tool

You can use the built-in Query Tool and run SQL queries to generate reports on the metadata of an open model. Query Tool is an ODBC-compliant tool built into erwin DM and lets you query various schemas.

Note: For more information about the schema on which you can query, see Appendix A, and for a list of useful queries, see Appendix B.

Follow these steps:

  1. Open a model in erwin DM, or connect to Mart and open a model.

    The ODBC driver connects to the data source from only one instance. If you have multiple instances of erwin DM running, by default, the ODBC driver connects to the first instance started. To change which instance of erwin DM is handling the ODBC connection, follow these steps:

    1. Go to the first instance of erwin DM.
    2. Click Tools, Options, Reporting, Stop ODBC Driver for this instance, and then click OK.

      The ODBC engine stops for this instance.

    3. Go to the instance from which you want to connect to Query Tool.
    4. Click Tools, Options, Reporting, Start ODBC Driver for this instance, and then click OK.
  2. Click Tools, Query Tool.

    The Query Tool appears.

  3. Click Connect to erwin ODBC.
  4. Paste your query in the Query section and then click Execute.

    The results of the query are displayed.

  5. Click Save Result Set as CSV.

    The Save As dialog appears.

  6. Enter a file name and select a folder to save the file, and then click Save.

You have generated a report on the model metadata using Query Tool.