PowerDesigner中NAME和COMMENT的互相转换,需要执行语句
转载自:https://www.cnblogs.com/xnxylf/p/3288718.html
由于PDM 的表中 Name 会默认=Code 所以很不方便, 所以需要将 StereoType 显示到表的外面来
打开[工具]->[显示属性](英文:Display Preferences) ->Content->Table->右边面板Columns框中 勾选: StereoType ,这样再在 StereoType中填入code字段相同内容就会显示在图形界面上了
使用说明: 在【Tools】-【Execute Commands】-【Edit/Run Script】 下。输入下面你要选择的语句即可,也可以保存起来,以便下次使用,后缀为.vbs。
需要注意的问题是:运行语句时必须在Module模式下,如果是导出报表时执行会出现错误提示。
1.Name转到Comment注释字段。一般情况下只填写NAME,COMMENT可以运行语句自动生成。
将该语句保存为name2comment.vbs
原地址的代码有一些格式上的错误,现已修正。
'如果comment为空,则填入name;如果不为空,则保留不变,这样可以避免已有的注释丢失.
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
if trim(tab.comment)="" then'如果有表的注释,则不改变它.如果没有表注释.则把name添加到注释里面.
tab.comment = tab.name
end if
Dim col ' running column
for each col in tab.columns
if trim(col.comment)="" then '如果col的comment为空,则填入name,如果已有注释,则不添加;这样可以避免已有注释丢失.
col.comment= col.name
end if
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut and trim(view.comment)="" 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
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
Private sub ProcessFolder(folder)
On Error Resume Next
Dim Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
tab.name = tab.comment
Dim col ' running column
for each col in tab.columns
if col.comment="" then
else
col.name= col.comment
end if
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
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
转载于:https://www.cnblogs.com/fengyun1853/p/9298370.html
PowerDesigner中NAME和COMMENT的互相转换,需要执行语句相关推荐
- python怎么换行输入而不执行_关于在IDLE中怎么换行继续敲写代码而不执行语句...
查看: 44535|回复: 29 [已解决]关于在IDLE中怎么换行继续敲写代码而不执行语句 电梯直达 发表于 2016-9-30 10:05:49 | 只看该作者 |倒序浏览 |阅读模式 马上注册, ...
- rjs子模板中如何按照顺序并且有序列地执行语句
page.visual_effect :fade, item, :duration => 0.5page.delay 0.5 dopage.visual_effect :highlight, & ...
- pdm生成java_PowerDesigner通过SQL语句生成PDM文件并将name和comment进行互相转换
本篇文章主要介绍了PowerDesigner通过SQL语句生成PDM文件并将name和comment进行互相转换 超详细过程(图文),具有一定的参考价值,感兴趣的小伙伴们可以参考一下 1.软件准备 软 ...
- PowerDesigner 中的name与comment转换(转)
2019独角兽企业重金招聘Python工程师标准>>> 1 PowerDesigner中批量根据对象的name生成comment的脚本 执行方法:Open PDM -- Tools ...
- PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法
1 PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法如下, 依次打开Tools – Execute Commands – Run Script,运行以 ...
- PowerDesigner中的对象与关系映射建模
概述 从80年代中期开始,随着C++语言的成功,面向对象语言已经成为软件开发中的主导语言.现在很多商用软件,尤其是企业信息系统,都是使用面向对象语言进行开发的.应用面向对象方法,我们通过类来抽 ...
- PowerDesigner生成mysql字段comment 注释
转载自 https://www.cnblogs.com/kangxuebin/articles/3688146.html PowerDesigner生成mysql字段comment 注释 最近需求出了 ...
- r中如何求变量的对数转换_对数转换以求阳性。
r中如何求变量的对数转换 In Simple terms, log transform squashes or compresses range of large numbers and expand ...
- PowerDesigner中的CDM设计的外键作主键的问题
PowerDesigner中的CDM设计的外键作主键的问题 From:tonyepaper.cnblogs.com 2009-09-15 00:58 两个实体之间是一对一的关系.两个实体的标识符是&q ...
最新文章
- MySQL数据库job怎么写_数据库中job是什么意思
- Python利用pymysql连接Mysql数据库
- boost::hana::detail::wrong用法的测试程序
- Java Class Loader Retrospect
- 纯做技术是自娱自乐 抛开技术做技术才是出路
- 双十一 手淘技术用了这几招
- Beeple最大藏家Metapurse拍卖B.20项目中所有NFT资产,底价5800万美元
- C++反汇编第一讲,认识构造函数,析构函数,以及成员函数
- 9个免费可商用的字体推荐
- Photoshop插件-黑白(四)-脚本开发-PS插件
- 微信小程序人脸识别功能(wx.faceDetect)、带扫脸动画、人脸图片获取(upng.js)及位置展示
- 国外免费图片素材站收集
- html文件匹配歌手名和歌名,获取QQ音乐歌手姓名、歌曲信息、播放链接,爬,起,qq,名字...
- 头歌--C++之if-else基本性质
- c语言void delayms,C语言题、谁帮我看看啊!!!!
- c语言怎么打出花边图案,甄嬛舌尖各种版本苏牙咬人 连黄梅戏C语言都来了
- Redis——Redis_Jedis实践
- 麻省理工学院公开课:计算机科学及编程导论习题2
- 如何创建.babelrc文件?
- 如何快速更新百度快照?