1 PowerDesigner中批量根据对象的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
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
2 PowerDesigner中逆向工程将数据库中comment脚本赋值到PDM的name
执行方法: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
if len(tab.comment) <> 0 then
tab.name = tab.comment
end if
On Error Resume Next
Dim col 'running column
for each col in tab.columns
if len(col.comment) <>0 then
col.name =col.comment
end if
On Error Resume Next
next
end if
next
end sub
分享到:
相关推荐
PowerDesigner 中name和comment 互换脚本,可以使用。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
powerDesigner 把name项添加到comment 使用方法使用方法 PowerDesigner->Tools->Execute Commands->Edit/Run Scripts 可以保存该脚本为:name2comment.vbs
PowerDesigner中使name列的值等于comment列的值的脚本,亲测可用
通常数据表字段使用英文,备注comment完成字段的说明。使用该脚本能够在PowerDesigner批量生成SQL脚本时将name生成数据库中字段的comment
PowerDesigner 中把Name值批量复制到Comment实用脚本,注意是在CDM和PDM中运行此脚本便可.PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
PowerDesigner里执行脚本命令,把name列的内容批量复制到comment列。
PowerDesigner里执行脚本命令,把comment列的内容批量复制到name列。
1 安装ODBC驱动,2 在控制面板添加添加ODBC,3 PowerDesigner连接MYSQL,4 MySQL表结构导入到PowerDesigner,5 显示Comment列,6 PowerDesigner表结构连同中文注释导入到MySQL
PowerDesigner 逆向工程脚本,comment2name.vbs 将字段注释转成字段名、表注释转成表名称, name2comment.vbs——名称转注释,已有注释不覆盖。在PowerDesigner 菜单里Tools——Excute Commands——Edit/Run Scripts....
>确定 <br>3、从PD菜单选择->Database->Generate Database->在弹出窗口中Tables与Columns下分别选中Comment->在Option标签页下选中Generate name in empty comment->确定 <br>让软件开发快乐起来
powerdesigner逆向工程导入mysql脚本生成PDM带全注释
使用PowerDesigner我经常只设置了Name和code,但是数据库里显示不了Name,显示的是描述,及comment。所以我可以通过执行一个脚本批量把列名(name)复制为描述(comment)。
PowerDesigner 常用设置大全。...设置6:如何把CODE的NAME中文也生成在脚本中,也就是列名后就是NAME的说明文字? 设置7:怎么在窗口中显示的是对象的Code而不是Name 设置8:name-comment- stereotype的相互自动copy
每次我用PowerDesigner设计数据库时,都只是注释了一些复杂的字段,一些简单的字段根本就不用注释,见到code就知道其中的意思,奈何本人英文水平有限,加上一些英文单词太长进行了简写,我就想要把字段名称name这列...
PowerDesigner中批量根据对象的name生成comment的脚本 PowerDesigner中逆向工程将数据库中comment脚本赋值到PDM的name
前言 一、创建概念数据模型 二、概念模型转为物理模型 三、创建物理数据模型 四、导出建库SQL脚本 五、导出数据库设计文档 1.使用向导生成数据字典文档 2.使用已有模板生成数据...2.PowerDesigner使用name生成comment
powdesigner设计了表,将name名自动复制到comment的vb语言写的脚本。
在PowerDesigner中按Ctrl + Shift + X,然后将下面的脚本粘贴进去或者打开文件,并运行,就可以将注释comment生成到列的name中去。显示注释操作:选择那个表,右键->Properties->Columns->Customize Columns and ...