powerDesigner 把name项添加到注释(comment)
2015-10-21 15:12
357 查看
第一次写博客,分享一点经验吧,平时大家用powerDesigner的时候,pd是不会把name项默认添加到comment的,所以生成的数据库表里面也没有中文字段的注释.
我在网上查了一下.有解决方案了.
以下是网上的解决方案,我把它完善了一下.
'使用方法使用方法
'PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
可以保存该脚本为:name2comment.vbs
'******************************************************************************
'* File: name2comment.vbs
'* Title: Name to Comment Conversion
'* Model: Physical Data Model
'* Objects: Table, Column, View
'* Author: steveguoshao
'* Created: 2013-11-29
'* Mod By:
'* Modified:
'* Version: 1.0
'* Memo: Modify from name2code.vbs
'******************************************************************************
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
转载自http://blog.csdn.net/steveguoshao/article/details/16940347
我在网上查了一下.有解决方案了.
以下是网上的解决方案,我把它完善了一下.
'使用方法使用方法
'PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
可以保存该脚本为:name2comment.vbs
'******************************************************************************
'* File: name2comment.vbs
'* Title: Name to Comment Conversion
'* Model: Physical Data Model
'* Objects: Table, Column, View
'* Author: steveguoshao
'* Created: 2013-11-29
'* Mod By:
'* Modified:
'* Version: 1.0
'* Memo: Modify from name2code.vbs
'******************************************************************************
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
转载自http://blog.csdn.net/steveguoshao/article/details/16940347
相关文章推荐
- 如何判断某变量是否为数组数据类型?
- Step7中有关时间和定时器的使用和例程2
- DOS命令行中用apache-maven-3.3.3 构建Java和Java Web项目
- 跟我学Guava:基础1.3-常见Object方法和复用他们
- spring mvc 和 jstl
- DDoS攻防战(三):ip黑白名单防火墙frdev的原理与实现
- DDoS攻防战(二):CC攻击工具实现与防御理论
- 年薪30万的Android程序员必须知道的帖子
- 使用数据处理函数
- 陈朱兴-js写法【案例】:
- json知识点总结(解析与序列化)
- Java F-bounded
- Java笔记集合
- fopen user guide in MATLAB
- 5ucms编辑器fckeditor的一些说明
- uGUI事件系统简述及使用方法总结
- Oracle10g以上sysaux表空间的维护和清理
- 离线LCA hdu2586 How far away ?
- springMVC 使用jstl
- js中使用jstl中得到的值