cancel
Showing results for 
Search instead for 
Did you mean: 

Power designer Setting up Character set at each column Using VBA

velurani
Explorer
0 Kudos
429

Hi

I am using the power designer 16.7. The data model database is Teradata 14.x . In the model for each varchar or char column the character set need to be defined. The current Character is set to LATIN or Null . I want to set all column to UNICODE using VBA script. I was looking for the character set property on column object in meta model I can find "character Case" at column object level , but could not find character set property. The code will be something similar as below. I want to know which column property i need to set for setting Character set to "UNOCODE" using VBA.

For Each col In tb.Columns

if col.datatype="CHAR" then

col.<<<<Characterset>>>> = "UNICODE"

Next

Thanks a lot

Ani

Accepted Solutions (1)

Accepted Solutions (1)

Ondrej_Divis
Contributor
0 Kudos

Hi Ani,

there is much easier way to do batch changes of such kind. Here is a simple 3-step procedure, that will help you achieve your goal.

  1. Open menu Model - Columns and make sure, that property CharacterSet is displayed. (it will be somewhere near the bottom of the "Customize Columns and Filter" window)
  2. Filter your columns only to CHAR datatype.
  3. Select all your columns desired to do the batch modification of CharSet and type your value (UNICODE) to one of them. It will automatically apply to all selected columns. See attached screenshot.

However, if you still need that modification done by script, you should do it like this:

For each col in tb.Columns
  If col.DataType = "CHAR" then
    col.SetExtendedAttribute "CharacterSet", "UNICODE"
  End if
Next

CharacterSet is not standard attribute. It is extended attribute and it has be handled differently.

Among other things, we are providing PowerDesigner trainings (from basic data modeling up to advanced customization and scripting), so if you happen to be interested, you can find me on LinkedIn. I have more than 15 years of experience with PD from various project and I`ll be happy to share my knowledge.

Kind Regards,

Ondrej Divis

Answers (1)

Answers (1)

velurani
Explorer
0 Kudos

Hi Ondrej Divis

Thanks a lot for providing the answers. I tried both the options and found both are working.

Appreciate your help

Ani