powerdesigner连接oracle——PDM显示注释

来自网络 利用vbs脚本完成。 在Sybase安装路径/VB Scripts下新建Comments2Name.vbs,内容如下:

OptionExplicit   
ValidationMode =True   
InteractiveMode = im_Batch   
 
Dim mdl 'the current model   
 
'get the current active model   
Set mdl = ActiveModel   
If (mdl IsNothing) Then   
MsgBox"There is no current Model"  
ElseIfNot mdl.IsKindOf(PdPDM.cls_Model) Then   
MsgBox"The current model is not an Physical Data model."  
Else   
ProcessFolder mdl   
EndIf   
 
'This routine copy name into code for each table, each column and each view   
'of the current folder   
Privatesub ProcessFolder(folder)   
 
Dim Tab 'running table   
foreach Tab in folder.tables   
ifnot tab.isShortcut then   
iflen(tab.comment) <>0then   
tab.name = tab.comment   
endif   
OnErrorResumeNext   
Dim col 'running column   
foreach col in tab.columns   
iflen(col.comment) <>0then   
col.name =col.comment   
endif   
OnErrorResumeNext   
next   
endif   
next   
end sub

在生成的PDM中, Powerdesigner界面-tools-Execute Cmmands-Edit/Run Scripts 在打开的界面中,左上角,选择打开,Ctrl+O,选取刚才的Comments2Name.vbs,并Run,效果同上。

猜你喜欢

转载自lizhuohuang.iteye.com/blog/1852708