How can an entity say with 100 columns (for example):
PERIOD_01 NUMBER
PERIOD_02 NUMBER
PERIOD_03 NUMBER
[...]
PERIOD_100 NUMBER
Be automated by changing column NUMBER to VARCHAR2 as shown above?
WORKAROUND:
You will have to create a script that will ask if an attribute has data type NUMBER, and for this data type, it will change it to another required datatype.
Set Attribute = Entity.CreateNewObject (2003)
Attribute.Name = "dw_source"
Set DataType_obj = Model.ModelDef.DataTypes.GetObjectById("{73D69F7E-A105-4B6F-987B-0BF532970C64}")
Attribute.SetLinkedObject "DataType", DataType_obj
Attribute.DataTypeParam1 = "30"
Attribute.Notes = "Source System ..."
Also, it is possible to get DataType_obj alternatively this way:
Set DataType_obj = Model.ModelDef.DataTypes.GetObjectByName("Varchar(%p1)")
STATUS:
NONE.
Note:
{73D69F7E-A105-4B6F-987B-0BF532970C64}
... it is ID of Varchar(x) data type valid for MS SQL Server 2005 database. IDs of data types can be found in Reference Guide (Help menu in TDM, Expert Mode must be turned on.).