PowerDesigner,根据name自动生成commnet的脚本
来源:互联网 发布:淘宝金酷娃警车 编辑:程序博客网 时间:2024/04/29 21:37
PowerDesigner在操作上有很多的不便性,但在库的设计及SQL代码生成上还是很强大的。
由于自己写的代码生成器能够根据comment生成相关字段注释,所以,commnet还是非常重要的。以前是通过手动一条条的从Name得到到comment中去,字段比较少倒是没什么感觉,这次项目很多表都是在一百多个字段以上,所以,有点吃力。于是,在网上找了点资料,然后自己稍微加工了下,脚本如下:
Option ExplicitValidationMode = TrueInteractiveMode = im_BatchDim mdl 'the current model'get the current active modelSet mdl = ActiveModelIf (mdl Is Nothing) ThenMsgBox "There is no current Model"ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) ThenMsgBox "The current model is not an Physical Data model."ElseProcessFolder mdlEnd If'This routine copy name into code for each table, each column and each view'of the current folderPrivate sub ProcessFolder(folder)Dim Tab 'running tablefor each Tab in folder.tablesif not tab.isShortcut thenDim col 'running columnfor each col in tab.columnsIf (col.comment="") Then '已存在的comment则不更新col.comment= col.nameend ifnextend ifnextDim view 'running viewfor each view in folder.Viewsif not view.isShortcut thenview.comment = view.nameend ifnext'go into the sub-packagesDim f 'running folderFor Each f In folder.Packagesif not f.IsShortcut thenProcessFolder fend ifNextend sub
这段代码也是从网上找的。主要是加了个如果comment的为空的情况下则从name复制,否则将不处理。
PowerDesigner里的脚本是VB写的。所以,如果对VB了解的话,还是可以编写很多东西的。
代码的使用,如下图:
在这里需要注意下,运行脚本时要先在PowerDesigner选中需要处理的PDM。
- PowerDesigner,根据name自动生成commnet的脚本
- PowerDesigner,根据name自动生成commnet的脚本
- PowerDesigner,根据name自动生成commnet的脚本
- PowerDesigner,根据name自动生成commnet的脚本
- PowerDesigner name commnet 自动生成脚本
- PowerDesigner创建表时如何根据输入的Name根据首字母自动生成Code的方法
- PowerDesigner中批量根据对象的name生成comment的脚本(转)
- PowerDesigner中批量根据对象的name生成comment的脚本
- PowerDesigner MySQL自动生成View的脚本的方法
- PowerDesigner 中 根据对象的name和comment 生成注释的办法
- PowerDesigner设置为不自动根据name填充code值
- powerdesigner中name自动转换到comment和comment2name的vbs脚本
- powerdesigner 生成脚本时 名字总是中文的解决办法 属性是name 不是code
- PowerDesigner中从注释生成Name的两个升级VBS脚本
- 使用powerdesigner导入sql脚本,生成物理模型,name和code都显示英文的解决方法
- PowerDesigner在生成脚本的过程中出现Constraint name uniquenessReference 解决办法
- powerdesigner生成SQL脚本的
- 根据PowerDesigner的模型生成数据库表
- Mysql命令集锦
- 微软Surface的商务应用
- win7下CSP修改方法
- jquery append追加,preppend预置
- strus2的action类交给spring管理action的class与spring的id相对应
- PowerDesigner,根据name自动生成commnet的脚本
- 通过查看日志文件检查SQL Server2000的安装错误
- CListCtrl使用技巧
- 查看分发数据库数据量sql2008
- vb安装战记
- myeclipse 优化
- 成功开发iPhone软件的10个步骤
- NDIS网络数据监控程序NDISMonitor(2)-----驱动与应用的中间层NdisHook
- PHP也可以当成Shell Script使用