`
touchmm
  • 浏览: 1038605 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

将PowerDesigner中列的name生成到注释comment中去

阅读更多

在PowerDesigner中按Ctrl + Shift + X,然后将下面的脚本粘贴进去,并运行,就可以

1、将列的name生成到注释comment中去

2、将列和表名变为大写

Option Explicit
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(PdCDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model."
Else
ProcessPkg mdl
End If

' This routine copy name into code for each table, each column and each view
' of the current folder
Private sub ProcessFolder(pkg)
Dim Tab 'running table
Dim col
for each Tab in pkg.entities
' 表注释
tab.comment = tab.name
' 表名大写
tab.code = Ucase(tab.code)
if not tab.isShortcut Then
For each col in tab.attributes
' 列注释
col.comment = col.name
' 列名大写
col.code = Ucase(col.code)
Next
End If
Next
End sub
Private Sub ProcessPkg(mdl)
ProcessFolder(mdl)
Dim subpkg
For each subpkg in mdl.packages
ProcessPkg(subpkg)
Next
End Sub

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics