如何让pd中同时显示name及telecode name 查询

powdesigner(1)
在进行模型与数据库结构同步的时候,如果使用oracle数据库,如果在模型中使用小写,或大小写混写的情况,当将结构同步到数据库中所有名称都会变成大写(因此生成的脚去除了引号),但是你在进行模型向数据同步时pd15会将这种情况认为是有差异的,而事实它们差异的,如果想要忽略这种差异.可以在数据库-&apply model changes to database菜单项的format选项卡中,设置character项中设置为upper或lower而不要设置成mixed,如下图所示:
此时在模型向数据库同步的时候就会忽略了
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:161750次
积分:2656
积分:2656
排名:第9907名
原创:88篇
转载:111篇
评论:12条
(2)(1)(5)(2)(3)(1)(4)(1)(1)(8)(4)(7)(12)(11)(3)(6)(5)(14)(11)(12)(15)(29)(22)(4)(4)(7)(4)(4)PD中使Name跟Comment关联 - PowerDesigner当前位置:& &&&PD中使Name跟Comment关联PD中使Name跟Comment关联&&网友分享于:&&浏览:108次PD中使Name和Comment关联
在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或Comment中写中文,在Code中写英文。Name用来显 示,Code在代码中使用,但Comment中的文字会保存到数据库Table或Column的Comment中,当Name已经存在的时候,再写一次 Comment很麻烦,可以使用以下代码来解决这个问题:· 代码一:将Name中的字符COPY至Comment中· '****************************************************************************** '*&& File:&&&&&&&&&& name2comment.vbs '*&& Purpose:&&&& Database&& generation&& cannot&& use&& object&& names&& anymore&& '&&&&&&&&&&&&&&&&&&&&&&&& in&& version&& 7&& and&& above. '&&&&&&&&&&&&&&&&&&&&&&&& It&& always&& uses&& the&& object&& codes. ' '&&&&&&&&&&&&&&&&&&&&&&&& In&& case&& the&& object&& codes&& are&& not&& aligned&& with&& your&& '&&&&&&&&&&&&&&&&&&&&&&&& object&& names&& in&& your&& model,&& this&& script&& will&& copy&& '&&&&&&&&&&&&&&&&&&&&&&&& the&& object&& Name&& onto&& the&& object&& Comment&& for&& '&&&&&&&&&&&&&&&&&&&&&&&& the&& Tables&& and&& Columns. ' '*&& Title:&&&&&&&& '*&& Version:&&&& 1.0 '*&& Company:&&&& Sybase&& Inc.&& '******************************************************************************Option&& Explicit ValidationMode&& =&& True InteractiveMode&& =&& im_BatchDim&& 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 &&&&&&&&&&&&&&&&& ment&& =&& tab.name &&&&&&&&&&&&&&&&& Dim&& col&& '&& running&& column &&&&&&&&&&&&&&&&& for&& each&& col&& in&& tab.columns &&&&&&&&&&&&&&&&&&&&&&& ment=&& col.name &&&&&&&&&&&&&&&&& next &&&&&&&&&&& end&& if &&&&& next&&&&& Dim&& view&& 'running&& view &&&&& for&& each&& view&& in&& folder.Views &&&&&&&&&&& if&& not&& view.isShortcut&& then &&&&&&&&&&&&&&&&& ment&& =&& 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--------------------------------------------另外在使用REVERSE ENGINEER从数据库反向生成PDM的时候,PDM中的表的NAME和CODE事实上都是CODE,为了把NAME替换为数据库中Table或Column的中文Comment,可以使用以下脚本:· 代码二:将Comment中的字符COPY至Name中Option&& Explicit ValidationMode&& =&& True InteractiveMode&& =&& im_BatchDim&& 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&& IfPrivate&& sub&& ProcessFolder(folder) On Error Resume Next &&&&& Dim&& Tab&& 'running&&&& table &&&&& for&& each&& Tab&& in&& folder.tables &&&&&&&&&&& if&& not&& tab.isShortcut&& then &&&&&&&&&&&&&&&&& tab.name&& =&& ment &&&&&&&&&&&&&&&&& Dim&& col&& '&& running&& column &&&&&&&&&&&&&&&&& for&& each&& col&& in&& tab.columns &&&&&&&&&&&&&&&&& ment="" then &&&&&&&&&&&&&&&&& else &&&&&&&&&&&&&&&&&&&&&&& col.name=&& ment &&&&&&&&&&&&&&&&& end if &&&&&&&&&&&&&&&&& next &&&&&&&&&&& end&& if &&&&& next&&&&& Dim&& view&& 'running&& view &&&&& for&& each&& view&& in&& folder.Views &&&&&&&&&&& if&& not&& view.isShortcut&& then &&&&&&&&&&&&&&&&& view.name&& =&& ment &&&&&&&&&&& 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-----------------------------------以上两段代码都是VB脚本,在PowerDesigner中使用方法为:&&& PowerDesigner-&Tools-&Execute Commands-&Edit/Run Scripts将代码Copy进去执行就可以了,是对整个CDM或PDM进行操作
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有PowerDesigner中NAME和COMMENT的互相转换,需要执行语句 - 落木 - 博客园
posts - 34, comments - 11, trackbacks - 0, articles - 1
/yelaiju/archive//3044828.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
原地址的代码有一些格式上的错误,现已修正。&
'把pd中那么name想自动添加到comment里面'如果comment为空,则填入如果不为空,则保留不变,这样可以避免已有的注释丢失.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(ment)=""&then'如果有表的注释,则不改变它.如果没有表注释.则把name添加到注释里面.&&&&&&&&&&&&&&&&&&&&&&&&ment&&&=&&&tab.name&&&&&&&&&&&&&&&&&&&&&end&if&&&&&&&&&&&&&&&&&&&&Dim&&&col&&&'&&&running&&&column&&&&&&&&&&&&&&&&&&&&&&for&&&each&&&col&&&in&&&tab.columns&&&&&&&&&&&&&&&&&&&&&&&&&&&if&trim(ment)=""&then&'如果col的comment为空,则填入name,如果已有注释,则不添加;这样可以避免已有注释丢失.&&&&&&&&&&&&&&&&&&&&&&&&&&&ment=&&&col.name&&&&&&&&&&&&&&&&&&&&&&&&&&&end&if&&&&&&&&&&&&&&&&&&&next&&&&&&&&&&&&&&&&end&&&if&&&&&&&&&&next&&&&&&&&&&&&Dim&&&view&&&'running&&&view&&&&&&&&&&for&&&each&&&view&&&in&&&folder.Views&&&&&&&&&&&&&&&&if&&&not&&&view.isShortcut&and&trim(ment)=""&&then&&&&&&&&&&&&&&&&&&&&&&ment&&&=&&&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.将Comment内容保存到NAME中,comment2name.vbs 实习互换。语句为:
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&&&&&&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&&&=&&&ment&&&&&&&&&&&&&&&&&&&&&Dim&&&col&&&'&&&running&&&column&&&&&&&&&&&&&&&&&&&&&&for&&&each&&&col&&&in&&&tab.columns&&&&&&&&&&&&&&&&&&&&&&if&ment=""&then&&&&&&&&&&&&&&&&&&&&&else&&&&&&&&&&&&&&&&&&&&&&&&&&col.name=&&&ment&&&&&&&&&&&&&&&&&&&&&&end&if&&&&&&&&&&&&&&&&&&&&next&&&&&&&&&&&&&&&&end&&&if&&&&&&&&&&next&&&&&&&&&&&&Dim&&&view&&&'running&&&view&&&&&&&&&&for&&&each&&&view&&&in&&&folder.Views&&&&&&&&&&&&&&&&if&&&not&&&view.isShortcut&&&then&&&&&&&&&&&&&&&&&&&&&&view.name&&&=&&&ment&&&&&&&&&&&&&&&&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&powerdesigner怎么设置name不等于code_百度知道

我要回帖

更多关于 telecode name used 的文章

 

随机推荐