PowerDesigner表字段變大寫的VB腳本,高級技能Get!

高級用法,字段字母全部變爲大寫,不用手動一個一個改

Option Explicit
ValidationMode = True
InteractiveMode = im_Batch

Dim mdl ' the current model

' 取得當前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)
    '處理表
   Dim Tab
   for each Tab in folder.tables
         tab.code = UCase(tab.code)
         '修改字段名
         Dim col
         for each col in tab.columns
            col.code= UCase(col.code)
         next
         '修改索引名
         Dim idx
         for each idx in tab.indexes
            idx.code= UCase(idx.code)
         next
         '修改主鍵名
         Dim key
         for each key in tab.keys
            key.code= UCase(key.code)
         next
   next

end sub

腳本執行:tools -> command -> Edit/Run Script

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章