Power Designer逆向工程匯入Oracle表,轉為模型加註釋

來源:互聯網
上載者:User

標籤:

1.開啟PowerDesigner ——檔案——Reverse Engineer——DataBase

2.選擇所要串連資料庫版本,此處使用的是oracle version 11g。

3.點擊紅色地區,選擇資料來源

4.選擇modify

5.在此填寫你的資料庫名稱、串連地址、使用者名稱。確定

6.選擇你建立立的串連資料庫

7.填寫需要轉換為模型的資料庫的使用者名稱和密碼

8.確定即可匯出為模型

9.如果資料庫中對錶或欄位有注釋,那麼通過下面的操作,可以讓這些注釋反映在物理模型上,在查看pdm圖時更容易理解。

選擇工具——Execute Commands——Edit /Run Script

10.將11步驟中的代碼粘貼到此處,然後執行。即成功加入注釋

11.  需要執行的指令碼語言(不需要做任何修改)

Option ExplicitValidationMode = TrueInteractiveMode = im_Batch Dim mdl ‘the current model ‘get the current active modelSet mdl = ActiveModelIf (mdl Is Nothing) ThenMsgBox "There is no current Model"ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) ThenMsgBox "The current model is not an Physical Data model."ElseProcessFolder mdlEnd If ‘This routine copy name into code for each table, each column and each view‘of the current folderPrivate sub ProcessFolder(folder) Dim Tab ‘running tablefor each Tab in folder.tablesif not tab.isShortcut thenif len(tab.comment) <> 0 thentab.name = tab.commentend ifOn Error Resume NextDim col ‘running columnfor each col in tab.columnsif len(col.comment) <>0 thencol.name =col.commentend ifOn Error Resume Nextnextend ifnextend sub

 

Power Designer逆向工程匯入Oracle表,轉為模型加註釋

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.