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

 

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