1、 從oracle 到 PDM文件 ?逆向工程中 ,需要注意 去掉“” ,這個百度下很多帖子,用于去掉引號?
2、 從注釋copy到name運行腳本會有個問題就是 ,有些注釋太長,不美觀?
解決方案, vb腳本判斷注釋中是否含有 空格,如果含有去 以空格 spilt后的數組的第一個 為 name, ?要求 寫注釋時 描述性文字 在字段名字后 要以空格 分開 例如
code : flag 。庫中 comment:?標志位 : 【 1、有效】 【0 、無效】 默認【1】
這樣逆向工程出來的效果?
3 運行腳本 如下 [運行方法 ,選中pdm文件中的表 ctrl+shift+X ,粘貼 復制 run ]
commet2namePerfect.vbs
?
'
******************************************************************************
'
* File: commet2namePerfect.vbs
'
* Title: commet to Name Conversion
'
* Purpose: To
'
'
* Model: Physical Data Model for Reverse Enginner
'
* Category: Naming Standards
'
* Author: cphmvp
'
* Created: Nov 22, 2013
'
* Mod By:
'
* Modified:
'
* Version: 1.0
'
* Comment:
'
* v1.0 - Must have Conversion Tables assigned as a model option
'
******************************************************************************
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 code 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
len
(
tab
.comment) <>
0
then
tab
.name =
tab
.comment
end
if
if
instr
(
tab
.comment,
"
"
)>
0
then
tab
.name =
split
(
tab
.comment,
"
"
)(
0
)
end
if
On
Error
Resume
Next
Dim
col
'
running column
for
each
col
in
tab
.columns
if
len
(col.comment) <>
0
then
col.name
=
col.comment
end
if
if
instr
(col.comment,
"
"
)>
0
then
col.name
=
split
(col.comment,
"
"
)(
0
)
end
if
On
Error
Resume
Next
next
end
if
next
end sub
?
?
?
?
oracle_powerdesinger逆向工程 , PDM 文件 注釋到name的完美解決方案 comment2name
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061
微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元

