PowerDesigner中批量根据对象的name生成comment的脚本
2011-10-26 16:12
316 查看
PowerDesigner中将对象中的name写到comment中,如果comment不为空,将name加在comment前面
执行方法:Open PDM -- Tools -- Execute Commands -- Run Script
Vb script代码
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 code 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 & tab.comment
Dim col 'running column
for each col in tab.columns
col.comment= col.name & col.comment
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.comment = view.name & view.comment
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
执行方法:Open PDM -- Tools -- Execute Commands -- Run Script
Vb script代码
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 code 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 & tab.comment
Dim col 'running column
for each col in tab.columns
col.comment= col.name & col.comment
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.comment = view.name & view.comment
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
相关文章推荐
- PowerDesigner中批量根据对象的name生成comment的脚本(转)
- PowerDesigner11中批量根据对象的name生成comment的脚本
- PowerDesigner11中批量根据对象的name生成comment的脚本
- PowerDesigner11中批量根据对象的name生成comment的脚本
- PowerDesigner11中批量根据对象的name生成comment的脚本
- PowerDesigner11中批量根据对象的name生成comment的脚本
- PowerDesigner 中 根据对象的name和comment 生成注释的办法
- PowerDesigner,根据name自动生成commnet的脚本
- PowerDesigner,根据name自动生成commnet的脚本
- PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法
- PowerDesigner,根据name自动生成commnet的脚本
- PowerDesigner 12.5 开启注释列 将Comment(注释)及Name(名称)内容互相COPY的VBS代码 根据名称生成注释(完整示例)
- PowerDesigner 12.5 开启注释列 将Comment(注释)及Name(名称)内容互相COPY的VBS代码 根据名称生成注释(完整示例)
- PowerDesigner,根据name自动生成commnet的脚本
- powerdesigner16.5将name字段附到comment中,并生成sql
- PowerDesigner 16 sql server 2008 生成脚本时备注报“对象名 'sysproperties' 无效”解决办法
- PowerDesigner建表脚本中去掉对象双引号的方法(name与code大小写转换)
- 解决方案:PowerDesigner 16生成的SqlServer 2000/2005/2008脚本执行出现:“对象名sysproperties无效”
- PowerDesigner创建表时如何根据输入的Name根据首字母自动生成Code的方法
- 将PowerDesigner中列的name生成到注释comment中去