PowerDesigner 中將Comment(註釋)及Name(名稱)內容互相COPY的VBS程式碼
[@more@]
'******************************************************************************
'* 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_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
tab.comment = tab.name
Dim col ' running column
for each col in tab.columns
col.comment= col.name
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.comment = 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
按住:ctrl+shift+x
PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
程式碼一:將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_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
tab.comment = tab.name
Dim col ' running column
for each col in tab.columns
col.comment= col.name
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.comment = 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
程式碼二:將Comment中的字元COPY至Name中
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 = tab.comment
Dim col ' running column
for each col in tab.columns
if col.comment="" then
else
col.name= col.comment
end if
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.name = view.comment
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
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 = tab.comment
Dim col ' running column
for each col in tab.columns
if col.comment="" then
else
col.name= col.comment
end if
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.name = view.comment
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 中將Comment(註釋)及Name(名稱)內容互相COPY的VBS程式碼
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10130206/viewspace-1037246/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- PowerDesigner 中將Comment(註釋)及Name(名稱)內容互相COPY的VBS程式碼(轉)
- PowerDesigner 同步Name到Comment 及 同步 Comment 到Name
- (轉)PowerDesigner 把Comment寫到name中 和把name寫到Comment中 pd7以後版本可用
- PowerDesigner中通過VBS指令碼修改模型資訊指令碼模型
- Oracle comment新增註釋Oracle
- 如何拿到註解@ApiModelProperty(value = “單位名稱“, name = “orgName“)中的value值;API
- 《Oracle comment on註釋資訊方法論》Oracle
- 整理課程中將程式碼部署上線(Heroku)的內容
- Oracle PL/SQL程式碼中的註釋OracleSQL
- IDEA Plugins:Show Comment(快捷顯示註釋)安裝及使用IdeaPlugin
- php中抓取網頁內容的程式碼PHP網頁
- 語種名稱程式碼
- Myclipse中修改類註釋顯示作者名稱與當前日期
- PowerDesigner中name和code取消自動關聯
- 有趣的程式碼註釋
- 註釋與反註釋Comment/Uncomment selected code in Visual C++ (轉)C++
- 如何把程式碼中的註釋批次刪除
- 程式碼註釋中的5要與3不要
- IDEA中修改程式碼中的註釋顏色Idea
- MongoDB db.serverStatus()輸出內容中文註釋MongoDBServer
- CSS程式碼註釋CSS
- php程式碼註釋PHP
- 程式碼才是最好的註釋
- 註釋程式碼的13技巧
- v$lock.type中的內容解釋
- ajax讀取檔案中內容的程式碼例項
- 怎樣使用程式碼得到bean:message 中的內容?Bean
- 請停止程式碼註釋
- javascript如何註釋程式碼JavaScript
- 正規表示式刪除Java程式碼中的註釋Java
- 使用VBS建立快捷方式的程式碼
- vbs指令碼獲取Am註冊路徑資訊指令碼
- swift中的名稱空間及動態載入類Swift
- JAXB名稱空間及名稱空間字首處理
- 如何檢視Oracle RAC叢集的叢集名稱(CLUSTER NAME)Oracle
- 程式設計師是否有義務做好程式碼的註釋?你做好程式碼註釋了嗎?程式設計師
- 將 Visual Studio .net 程式碼註釋 英文轉為中文
- 用python寫一個指令碼,讀取srt檔案中的內容,並列印出重複的內容,且將不重複的內容儲存到新檔案中Python指令碼