cancel
Showing results for 
Search instead for 
Did you mean: 

Domain Data type information Using script

velurani
Explorer
0 Kudos

Hi All

I was trying to gather  the data type information using Script

For Each d In model.Domains

Debug.Print d.Name

Debug.Print d.DataType

Next

Shows the below results

Name

A30

Short description

A80

Identifier

N5

Money

MN8,2

Phone

A12

I could not get the  data type information properly ( I am not sure what A30, N5 etc ). Can you please guide me to get the proper value for data types. Appreciate your help 

Ani 

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185199
Contributor
0 Kudos


These are internal"abstract" Datatype which will translated at generation time or at displaytime  to the choosen DBMS Datatype, when you are in a PDM, i a CDM they are they are the primary datatypes, thought.

see some tables as an example to understand the concept:

from MSQL to internal:

and Internal to Postgres:

A is Alpha and will translatet to CHar, Varchar or whatever TargetDB understands, MN is Money and will be traslated to Mony, or it TargetDB does not have Moneytype to decimal or somehow.

running your script on MSSQL target gives this:

VB Script started on 31.10.2014 at 09:45:51

Domain_1

BINARY LARGE OBJECT

Domain_2

CHAR(5)

VB Script terminated on 31.10.2014 at 09:45:51.

on ANSI level2 gives this :

VB Script started on 31.10.2014 at 09:49:33

Domain_1

CHAR(254)

Domain_2

CHAR(5)

VB Script terminated on 31.10.2014 at 09:49:33.

and in a cdm gives this:

VB Script started on 31.10.2014 at 09:52:00

Domain_1

BL

Domain_2

A5

VB Script terminated on 31.10.2014 at 09:52:00.

HTH

dj

Message was edited by: dirk jaeckel

velurani
Explorer
0 Kudos

dj

  Thanks for the reply. I tried the script in LDM , while running the script it shows A30 etc . But when I opened the domain dialogue , It shows the correct datatypes So I am not how it translate it correctly when we open the domain list in the tool. 

BTW do you have any clue which object m,PD store all the data types.



Ani

former_member185199
Contributor
0 Kudos


LDM is like CDM independent from Physics, the other part of your question i dont understand.

you can try domain.preview to translate the datatype:

Preview As String

Get Code Preview. This attribute contains a preview of what would be
generated for this object.


if you dont see the code then, you have to change generation settings swich generation of domains on

HTH

dj

velurani
Explorer
0 Kudos

dj,

Thanks. Let me elaborate the second question.  In the Please see below image , when I open the domain list  from the model  you can see lots of data type as a list being shown in ldm itself. From which object , we can get the data types that can be used for any domains

Ani

former_member185199
Contributor
0 Kudos

Maybe they are hardcoded, i find only this :

there you can see and redefine the types of every internal type

velurani
Explorer
0 Kudos

dj,

How to get the list using script ?

Ani

former_member185199
Contributor
0 Kudos

as i wrote before: no clue, i think they are hardcoded, the form doesn´t look really dynamic

maybe the developers can answer this, but you can try read them from your targetdatabase

have a nice weekend