Hello,
herebelow the solution I found for now; not the most elegant in my opinion, but at least it works.
Should anyone have a better solution... let me know ;-)
STEP 1:
Create new Transformation Template for DDL language:
Type: <none>
Name: DataType_Aliases
Content:
%attType == "PRODTYPE" ? "VARCHAR(11)"%
%attType == "PRODREF" ? "VARCHAR(6)"%
%attType == "PRODID" ? "VARCHAR(6)"%
Basically you list there all your custom datatype conversion needs in that ugly format :-) Your alias on the left side (here "PRODTYPE", "PRODREF",... ), the wished translation on the right.
STEP 2:
Update the DDL -> Attribute template as follows:
Column
{
%TRANSFORM_CURRENT("type", "stereotype", "collection", "constant", "containment", "ordered", "static", "volatile")%
$DTA=%DataType_Aliases()%
%if $DTA!=""%
type=%qt%$DTA%qt%
%else%
type=%qt%%CONVERT_TYPE(genOptDefaultDatabase,attType)%%qt%
%endIf%
}
Here it calls the macro with the mappings, and if he founds a match the thing gets replaced, else we stay with the original attType(= Column datatype) procedure.
STEP 3:
Now when you call "Transform current package" on your data model package, and select DDL as output... magic happens.
Any better idea welcome ;-)
Cheers.