Powerdesigner SqlServer轉Oracle(轉)

來源:互聯網
上載者:User

標籤:

參考文章,原文地址:http://blog.csdn.net/cicada688/article/details/7802881

問題1:sqlserver資料庫直接轉oracle。欄位類型由sql server的類型轉換到oracle類型

問題2:sql server的欄位有大小寫問題。需要全部轉為大寫的形式

----------------------------------------------------

Powerdesigner內將資料庫的配型轉換為Oracle類型

這樣欄位的類型都切換為Oracle類型的

-------------------------------------------------欄位全部修改為大寫的方式

使用方法:進入PowerDesigner,開啟需要轉換的PDM,在功能表列找到:Tools – Excute Commands – Edit/Run Script,或者直接按Ctrl+Shift+X調出指令碼執行視窗,輸入下邊的代碼就可以了。

 

 

指令碼如下:

    ‘*****************************************************************************       ‘檔案:powerdesigner.ucase.VBs       ‘版本:1.0       ‘功能:遍曆物理模型中的所有表,將表名、表代碼、欄位名、欄位代碼全部由小寫改成大寫;       ‘ 並將序列的名和代碼由小寫改成大寫。       ‘用法:開啟物理模型,運行本指令碼(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      ‘*****************************************************************************       ‘函數:ProcessSequences       ‘功能:遞迴遍曆所有的序列       ‘*****************************************************************************       sub ProcessSequences(folder)       ‘處理模型中的序列:小寫改大寫       dim sequence       for each sequence in folder.sequences       sequence.name = UCase(sequence.name)       sequence.code = UCase(sequence.code)       next       end sub      ‘*****************************************************************************       ‘函數:ProcessTables       ‘功能:遞迴遍曆所有的表       ‘*****************************************************************************       sub ProcessTables(folder)       ‘處理模型中的表       dim table       for each table in folder.tables       if not table.IsShortCut then       ProcessTable table       end if       next       ‘對子目錄進行遞迴       dim subFolder       for each subFolder in folder.Packages       ProcessTables subFolder       next       end sub      ‘*****************************************************************************       ‘函數:ProcessTable       ‘功能:遍曆指定table的所有欄位,將欄位名由小寫改成大寫,       ‘ 欄位代碼由小寫改成大寫       ‘ 表名由小寫改成大寫       ‘*****************************************************************************       sub ProcessTable(table)       dim col       for each col in table.Columns       ‘將欄位名由小寫改成大寫       col.code = UCase(col.code)       col.name = UCase(col.name)       next       table.name = UCase(table.name)       table.code = UCase(table.code)       end sub  

欄位全部被替換成了大寫。

 

 

Powerdesigner SqlServer轉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.