吉安建设局官方网站,公众号登录微信公众号登录,帮助做APP的网站公司,注册公司新规定最新2024本篇文章主要介绍了PowerDesigner通过SQL语句生成PDM文件并将name和comment进行互相转换 超详细过程(图文)#xff0c;具有一定的参考价值#xff0c;感兴趣的小伙伴们可以参考一下1.软件准备软件#xff1a;Navicat 11.1#xff0c;Powerdesigner 152.安装步骤第一步…本篇文章主要介绍了PowerDesigner通过SQL语句生成PDM文件并将name和comment进行互相转换 超详细过程(图文)具有一定的参考价值感兴趣的小伙伴们可以参考一下1.软件准备软件Navicat 11.1Powerdesigner 152.安装步骤第一步将要生成的数据库导出为sql文件第二步打开PowerDesigner选择File--Reverse Engineer -- Database...第三步选择MySQL5.0数据库第四步找到第一步生成的Sql文件点击确定即可PowerDesigner中NAME和COMMENT的互相转换,需要执行语句由于PDM 的表中 Name 会默认Code 所以很不方便, 所以需要将 StereoType 显示到表的外面来打开[工具]-[显示属性](英文:Display Preferences) -Content-Table-右边面板Columns框中 勾选: StereoType ,这样再在 StereoType中填入code字段相同内容就会显示在图形界面上了使用说明: 在【Tools】-【Execute Commands】-【Edit/Run Script】 下。输入下面你要选择的语句即可也可以保存起来以便下次使用后缀为.vbs。需要注意的问题是运行语句时必须在Module模式下如果是导出报表时执行会出现错误提示。1.Name转到Comment注释字段。一般情况下只填写NAMECOMMENT可以运行语句自动生成。将该语句保存为name2comment.vbs把pd中那么name想自动添加到comment里面如果comment为空,则填入name;如果不为空,则保留不变,这样可以避免已有的注释丢失.Option ExplicitValidationMode TrueInteractiveModeim_BatchDim mdl the current modelget the current active modelSet mdl ActiveModelIf (mdl Is Nothing) ThenMsgBox There is no current ModelElseIf Not mdl.IsKindOf(PdPDM.cls_Model) ThenMsgBox The current model is not an Physical Data model.ElseProcessFolder mdlEnd IfThis routine copy name into comment for each table, each column and each viewof the current folderPrivate subProcessFolder(folder)Dim Tab running tablefor each Tab infolder.tablesif not tab.isShortcut thenif trim(tab.comment) then如果有表的注释,则不改变它.如果没有表注释.则把name添加到注释里面.tab.comment tab.nameend ifDim col running columnfor each col in tab.columnsif trim(col.comment) then 如果col的comment为空,则填入name,如果已有注释,则不添加;这样可以避免已有注释丢失.col.commentcol.nameend ifnextend ifnextDim view running viewfor each view infolder.Viewsif not view.isShortcut and trim(view.comment) thenview.commentview.nameend ifnextgo into the sub-packagesDim f running folderFor Each f Infolder.Packagesif not f.IsShortcut thenProcessFolder fend ifNextend sub2.将Comment内容保存到NAME中comment2name.vbs 实习互换。语句为Option ExplicitValidationMode TrueInteractiveModeim_BatchDim mdl the current modelget the current active modelSet mdl ActiveModelIf (mdl Is Nothing) ThenMsgBox There is no current ModelElseIf Not mdl.IsKindOf(PdPDM.cls_Model) ThenMsgBox The current model is not an Physical Data model.ElseProcessFolder mdlEnd IfPrivate subProcessFolder(folder)On Error Resume NextDim Tab running tablefor each Tab infolder.tablesif not tab.isShortcut thentab.name tab.commentDim col running columnfor each col in tab.columnsif col.comment thenelsecol.namecol.commentend ifnextend ifnextDim view running viewfor each view infolder.Viewsif not view.isShortcut thenview.nameview.commentend ifnextgo into the sub-packagesDim f running folderFor Each f Infolder.Packagesif not f.IsShortcut thenProcessFolder fend ifNextend sub