Using domains with check constraint rules in TDM 3

Hello,

I am trying to use domains in my physical modeling (MS SQL 2005) and assign some check constraint rules to them. However, to generate proper DDL scripts, I don’t know how to make the check constraint rule as a “macro” that will generate a proper script for every column where this domain (and the connected rule) will be used.

i.e.
I create a domain “SurrogateKey” and assign this domain to columns in different tables, like “CompanyId”, “PersonId”. I create a check constraint rule “PositiveNumber” and I apply this rule to my “SurrogateKey” domain. How to write the SQL for this rule so that it will be used for every column?
I tried to find some solutions online. I think in TDM 2 the solution was to use macro %values% and write something like this:

%value% > 0

but this is not working for me in TDM 3.

Is there some kind of a document macro list which can be used in TDM 3?

If I am missing something, please let me know. Thank you for any answer.

Hello,

Unfortunately, macros are not supported in TDM version 3 for now.
Anyway, we will deal with this task. It’s already been entered as request CR # 38 986.

Thanks very much for your patience.

Regards,

Vladka

Thank you for your answer.

Unfortunately, looking at your response, may I suggest that “Check constraint rules…” functionality is disabled in TDM 3 future releases, until it can actually be used. Now it is practically useless and it’s existence is therefore misleading to new users (of course, the same rule should be applied for possibly any other functionality which can not actually be used).

Hello,

Thank you for your suggestion. We will discuss it in our team. CR # 43 654.

Thanks again.

Regards,

Vladka

Hi,
We also need the ability to add check constraints to domains.
There needs to be some way to get the generated SQL to substitue the actual column name.
Regards
Malcolm

Thanks Malcolm for your remarks on this issue.

All this wil be taken into consideration.

Thanks.

Vladka

Any time frame on macro support ? IMHO this is a must (and is a feature allready present in earlier TDM versions !!)

Hi,

there are two Application Variables (earlier called macros) avaiable. %TableName% and %ColumnName%

A simple flash movie shows how to use application variable in Domains:
http://modeling.inside.quest.com/entry.jspa?categoryID=158&externalID=2887

Regards,

Vaclav

I know this post quite old. but I am wondering what version of TDM supports such Application Variables. My TDM is of 6.3.2, but it doesn't support ColumnName in Check Constraints template.

Thanks
-Autumn

Hi Autumn,
version 6.3 already supports it. See screenshot


You can use app.var. "ColumnName" in attribute check constraint. In this case it return attribute/column of this check constrain.
Be aware that it is not available for Entity Constraints.

Best Regards
Petr