zoukankan      html  css  js  c++  java
  • Powerdesigner SqlServer转Oracle(转)

    参考文章,原文地址: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  

    字段全部被替换成了大写。

  • 相关阅读:
    【python爬虫实战】使用词云分析来分析豆瓣影评数据
    【python爬虫实战】爬取豆瓣影评数据
    【个人博客设计】开发工具篇
    使用xmake优雅地描述工程
    使用lua实现try-catch异常捕获
    tbox新增stackless协程支持
    如何快速构建一个简单的程序
    手写数字识别系统之倾斜矫正
    手写数字识别系统之图像分割
    聊聊原子操作那些事
  • 原文地址:https://www.cnblogs.com/wangjunwei/p/5558749.html
Copyright © 2011-2022 走看看