*****************  花有重开日,人无再少年。**************

1.在设计概念模型数据时,Name后期为字段备注信息来源,Code为主数据字段

Powerdesigner16.5中物理模型添加字段备注

 

2.转换:cdm -> ldm - > pdm ,转换到物理模型的时候进行设置

 ①.转到物理模型进行如下操作:Tools -> Display Preferences

 Powerdesigner16.5中物理模型添加字段备注

 ②.点击Advanced,打开对应的设置界面

 Powerdesigner16.5中物理模型添加字段备注

 ③.点击Columns -> List columns

Powerdesigner16.5中物理模型添加字段备注

 ④.把Code勾选上,一路ok即可

Powerdesigner16.5中物理模型添加字段备注

 

3.设置完成以上步骤后,下一轮操作:Tools -> Execute Commands -> Edit/Run Script

 ①.打开edit界面:

Powerdesigner16.5中物理模型添加字段备注

 ②.将下面的脚本拷贝到edit中,Run执行

 -- Name中的字符COPY至Comment中

'代码一:将Name中的字符COPY至Comment中


Option   Explicit 
ValidationMode   =   True 
InteractiveMode   =   im_Batch

Dim   mdl   '   the   current   model

'   get   the   current   active   model 
Set   mdl   =   ActiveModel 
If   (mdl   Is   Nothing)   Then 
      MsgBox   "There   is   no   current   Model " 
ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then 
      MsgBox   "The   current   model   is   not   an   Physical   Data   model. " 
Else 
      ProcessFolder   mdl 
End   If

'   This   routine   copy   name   into   comment   for   each   table,   each   column   and   each   view 
'   of   the   current   folder 
Private   sub   ProcessFolder(folder) 
      Dim   Tab   'running     table 
      for   each   Tab   in   folder.tables 
            if   not   tab.isShortcut   then 
                  tab.comment   =   tab.name 
                  Dim   col   '   running   column 
                  for   each   col   in   tab.columns 
                        col.comment=   col.name 
                  next 
            end   if 
      next

      Dim   view   'running   view 
      for   each   view   in   folder.Views 
            if   not   view.isShortcut   then 
                  view.comment   =   view.name 
            end   if 
      next

      '   go   into   the   sub-packages 
      Dim   f   '   running   folder 
      For   Each   f   In   folder.Packages 
            if   not   f.IsShortcut   then 
                  ProcessFolder   f 
            end   if 
      Next 
end   sub
View Code

相关文章:

  • 2022-01-31
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-09-24
  • 2021-09-23
  • 2021-12-27
  • 2021-07-26
猜你喜欢
  • 2021-07-25
  • 2022-01-26
  • 2022-02-24
  • 2022-12-23
  • 2021-05-08
  • 2022-01-04
相关资源
相似解决方案