日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

PowerDesigner 表名、字段大小写转换

發布時間:2025/3/16 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 PowerDesigner 表名、字段大小写转换 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

面對不同的數據庫大小寫規范,一個個字段修改太麻煩了,如果使用了PowerDesigner設計,有比較簡單的方法。進入PowerDesigner,打開一個PDM,在菜單欄找到:Tools – Excute Commands – Edit/Run Script,或者直接按Ctrl+Shift+X調出腳本執行窗口,輸入下邊的代碼就可以了。使用的是VBScript,語義比較容易理解,可以根據自己的需求修改。

打開模型 Tools-->Execute Commands --> Edit/Run Script

UCase大寫 LCase小寫

輸入以下語句(根據實際情況可做相應調整)

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

' 同理處理視圖
' Dim view
'?? for each view in folder.Views
?? '?? if not view.isShortcut then
?????? ' view.code = 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

總結

以上是生活随笔為你收集整理的PowerDesigner 表名、字段大小写转换的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。