Toad World® Forums

Using domains with check constraint rules in TDM 3


#1

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.


#2

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


#3

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).


#4

Hello,

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

Thanks again.

Regards,

Vladka


#5

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


#6

Thanks Malcolm for your remarks on this issue.

All this wil be taken into consideration.

Thanks.

Vladka


#7

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


#8

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