pdm大写小写转换
'*****************************************************************************
?'文件:powerdesigner.LCase.VBs
?'版本:1.0
?'功能:遍歷物理模型中的所有表,將表名、表代碼、字段名、字段代碼全部由小寫改成大寫;
?' 并將序列的名和代碼由小寫改成大寫。
?'用法:打開物理模型,運(yùn)行本腳本(Ctrl+Shift+X)
?'備注:
?'*****************************************************************************
?dim model 'current model
?set model = ActiveModel
If (model Is Nothing) Then
?MsgBox "There is no current Model"
?ElseIf Not model.IsKindOf(PdPDM.cls_Model) Then
?MsgBox "The current model is not an Physical Data model."
?Else
?ProcessTables model
?ProcessSequences model
?End If
'*****************************************************************************
?'函數(shù):ProcessSequences
?'功能:遞歸遍歷所有的序列
?'*****************************************************************************
?sub ProcessSequences(folder)
?'處理模型中的序列:小寫改大寫
?dim sequence
?for each sequence in folder.sequences
?sequence.name = LCase(sequence.name)
?sequence.code = LCase(sequence.code)
?next
?end sub
'*****************************************************************************
?'函數(shù):ProcessTables
?'功能:遞歸遍歷所有的表
?'*****************************************************************************
?sub ProcessTables(folder)
?'處理模型中的表
?dim table
?for each table in folder.tables
?if not table.IsShortCut then?
ProcessTable table
?end if
?next
?'對(duì)子目錄進(jìn)行遞歸
?dim subFolder
?for each subFolder in folder.Packages
?ProcessTables subFolder
?next?
end sub
'*****************************************************************************
?'函數(shù):ProcessTable
?'功能:遍歷指定table的所有字段,將字段名由小寫改成大寫,
?' 字段代碼由小寫改成大寫
?' 表名由小寫改成大寫?
'*****************************************************************************
?sub ProcessTable(table)
?dim col
?for each col in table.Columns
?'將字段名由小寫改成大寫
?col.code = LCase(col.code)
?col.name = LCase(col.name)
?next?
table.name = LCase(table.name)
?table.code = LCase(table.code)
?end sub
?'文件:powerdesigner.LCase.VBs
?'版本:1.0
?'功能:遍歷物理模型中的所有表,將表名、表代碼、字段名、字段代碼全部由小寫改成大寫;
?' 并將序列的名和代碼由小寫改成大寫。
?'用法:打開物理模型,運(yùn)行本腳本(Ctrl+Shift+X)
?'備注:
?'*****************************************************************************
?dim model 'current model
?set model = ActiveModel
If (model Is Nothing) Then
?MsgBox "There is no current Model"
?ElseIf Not model.IsKindOf(PdPDM.cls_Model) Then
?MsgBox "The current model is not an Physical Data model."
?Else
?ProcessTables model
?ProcessSequences model
?End If
'*****************************************************************************
?'函數(shù):ProcessSequences
?'功能:遞歸遍歷所有的序列
?'*****************************************************************************
?sub ProcessSequences(folder)
?'處理模型中的序列:小寫改大寫
?dim sequence
?for each sequence in folder.sequences
?sequence.name = LCase(sequence.name)
?sequence.code = LCase(sequence.code)
?next
?end sub
'*****************************************************************************
?'函數(shù):ProcessTables
?'功能:遞歸遍歷所有的表
?'*****************************************************************************
?sub ProcessTables(folder)
?'處理模型中的表
?dim table
?for each table in folder.tables
?if not table.IsShortCut then?
ProcessTable table
?end if
?next
?'對(duì)子目錄進(jìn)行遞歸
?dim subFolder
?for each subFolder in folder.Packages
?ProcessTables subFolder
?next?
end sub
'*****************************************************************************
?'函數(shù):ProcessTable
?'功能:遍歷指定table的所有字段,將字段名由小寫改成大寫,
?' 字段代碼由小寫改成大寫
?' 表名由小寫改成大寫?
'*****************************************************************************
?sub ProcessTable(table)
?dim col
?for each col in table.Columns
?'將字段名由小寫改成大寫
?col.code = LCase(col.code)
?col.name = LCase(col.name)
?next?
table.name = LCase(table.name)
?table.code = LCase(table.code)
?end sub
總結(jié)
- 上一篇: android系统重力感应传感器 方向控
- 下一篇: 学生管理系统设计与实现(C++实现)