PD生成SQL脚本附带注释命令
'------------------------------------------------------------
'
'脚本功能:
' PowerDesigner中批量根据对象的name生成comment的脚本
'执行方法:
' Open PDM--Tools--Execute Commands--Run 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 folde
'------------------------------------------------------------
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
'------------------------------------------------------------
最新文章
- <;textarea>;输入框提示文字
- 程序员书单_java专项进阶篇
- UVa 714 (二分) Copying Books
- C# 整形数组排序
- HDU 1078 FatMouse and Cheese【记忆化搜索】
- apache2.4配置虚拟主机
- Bone Collector(01背包+记忆化搜索)
- webstorm for mac 破解步骤
- python之路day11--装饰器形成的过程、作用、装饰器的固定模式
- C++-int类型整数超出范围后的处理
- PMP学习经验总结——ITTO第六版教材
- 2018.11.01 loj#2319. 「NOIP2017」列队(线段树)
- 【Python】远离 Python 最差实践,避免挖坑
- STM32 HAL库学习系列第3篇 常使用的几种延时方式
- hihocoder155周 任务分配
- Oracle 常用系统包
- Windows下SVN回滚到旧版本(TortoiseSVN)
- ringMVC——redirect重定向跳转传值
- 让footer始终位于页面的最底部
- (转) Android Service完全解析,关于服务你所需知道的一切(上)