wbray
December 28, 2009, 9:28am
1
I would like to add three new domains with names, datatypes, and check constraints as follows:
flag, varchar2(1), <attr/clmn> in (‘N’,‘Y’);
date, date, trunc(<attr/clmn>) = <attr/clmn> (i.e., ensures time component is always 00:00:00 and can be ignored); and
datetime, date, no chk cons (i.e., time component is meaningful)
I’m building the model in the LER and performing a model conversion to the PER.
Defining the rules, check constraints, variable column names (<attr/clmn>), and the interaction between the rules and check constraints is confusing.
I’d appreciate any pointers.
wbray
December 28, 2009, 1:38pm
2
I’m following up my question with an answer and, what appears to be, a bug.
LER
Create Rule rul_Flag with Rule Properties -> SQL set to: %ColumnName% in (‘N’,‘Y’).
Create Domain dom_Flag with datatype VarChar(%p1), Length 1 and Rule set to rul_Flag.
Create attribute active_flag with Domain dom_Flag.
Use Simple Model Conversion to transform LER to PER.
PER
Attribute active_flag has dom_Flag as its Domain.
SQL Preview for the entity shows: … active_flag Varchar2(1 ) NOT NULL CHECK (–active_flag in (‘N’,‘Y’)) …
Close … but with the addition of a comment delimeter (–) in my check constraint.
Any ideas on how to get rid of the double-dash?
Thanks.
vladka
December 31, 2009, 1:42pm
3
Hello,
Instead of Simple Model Conversion, please use the Sync & Convert Wizard (File menu | Sync & Convert | Sync & Convert Wizard).
On page Action, select Convert Model… Go through the steps and on page Settings, take notice of the “Comment Out Database Specific Items” checkbox.
Feel free to select or clear it.
Regards,
Vladka + TDM Team
wbray
January 6, 2010, 11:56am
4
Clearing the checkbox fixed the problem.
Thanks.
Brian