使用方法使用方法
PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
'如果comment为空,则填入name;如果不为空,则保留不变。
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
Dim system, file
Set system = CreateObject("Scripting.FileSystemObject")
Dim ForReading, ForWriting, ForAppending '打开文件选项
ForReading = 1 ' 只读
ForWriting = 2 ' 可写
ForAppending = 8 ' 可写并追加
'打开文本文件
Set file = system.OpenTextFile("C:\pdcomment.txt", ForWriting, true)
'判断当前model是否物理数据模型
Dim mdl
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "处理对象无模型"
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "当前模型不是物理数据模型"
Else
ProcessFolder mdl,file
End If
file.Close
'******************************************************************************
Private sub ProcessFolder(folder,file)
Dim tab 'running table
for each tab in folder.tables
if not tab.isShortcut then
if trim(tab.comment)="" then
tab.comment = tab.name
end if
Dim col
for each col in tab.columns
if trim(col.comment)="" then
col.comment = col.name
end if
next
end if
next
Dim view
for each view in folder.Views
if not view.isShortcut and trim(view.comment)="" then
view.comment = view.name
end if
next
end sub
分享到:
相关推荐
PowerDesigner->Tools->Execute Commands->Edit/Run Scripts 将comment覆盖name。 将name自动填充到注释(comment)。
powerDesigner 把name项添加到comment 使用方法使用方法 PowerDesigner->Tools->Execute Commands->Edit/Run Scripts 可以保存该脚本为:name2comment.vbs
通常数据表字段使用英文,备注comment完成字段的说明。使用该脚本能够在PowerDesigner批量生成SQL脚本时将name生成数据库中字段的comment
powerdesigner视图不支持name,code,comment(列注释)同时显示,本文档完美解决了这个问题。快乐源于分享,需要的拿走
PowerDesigner里执行脚本命令,把name列的内容批量复制到comment列。
NULL 博文链接:https://yanfei133.iteye.com/blog/1483094
PowerDesigner 中把Name值批量复制到Comment实用脚本,注意是在CDM和PDM中运行此脚本便可.PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
powerdesigner逆向工程导入mysql脚本生成PDM带全注释
将powerdesigner中物理模型的英文字段名称转换为显示注释
PowerDesigner里执行脚本命令,把comment列的内容批量复制到name列。
在数据库设计中,经常使用数据库逆向工程,将数据库中库表结构转为PDM,为了阅读方便,需要将将表字段的comment转换为PDM的name。该文件解决此问题
PowerDesigner 中name和comment 互换脚本,可以使用。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
PowerDesigner中使name列的值等于comment列的值的脚本,亲测可用
NULL 博文链接:https://stunizhengjia.iteye.com/blog/2018543
可以很好的实现comment和name之间的相互转换,针对mysql数据库表的设计很方便
PowerDesigner15-将Name中的字符COPY至Comment中.vbs
PowerDesigner15操作说明-将Comment中的字符COPY至Name中.vbs
在用powerdesigner进行数据建模的时候,经常会遇到修改字段名,修改字段类型,在指定字段后面新加字段等操作,这个时候你可能就需要用脚本实现了,这个资料就是实现这些功能的,在powerdesigner15里测试可用
powerdesigner中name和code相关联对程序设计造成不便,可以按照文档进行设置;对于powerdesigner导出的sql代码有引号的解决方案。
使用PowerDesigner我经常只设置了Name和code,但是数据库里显示不了Name,显示的是描述,及comment。所以我可以通过执行一个脚本批量把列名(name)复制为描述(comment)。