Toad World® Forums

How to know target database of current model?

Hi,

We have a macro that creates a “basic table”. This is a table with some common fields to all tables.
Is there a way to know the target database of current model? The goal is to use this macro with distinct databases, with very few customizations in some fields depending on database (Oracle, mysql, sqlserver).

Thanks!

Biel B.

Hi,
you have two choices.

  1. Use visibility property in Macro. In Macro properties see tab Visibility. You can choose Databases for which will be macro accessible.

  2. For determine DB in macro you can use

    Model.DatabaseDef.Name

    or
    Model.DatabaseDef.Abbrev

For more info see reference guide class DatabaseDefinition

Daril

Thanks Daril!

We’ll try #2.

Biel B.