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  

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

  • 相关阅读:
    js获取客户端time,cookie,url,ip,refer,user_agent信息:
    生成springboot docker镜像 并上传到阿里云镜像厂库
    install pymongo,mysql
    No module named MYSQLdb 问题解决
    CentOS7下安装python-pip
    task_payment_byonlinedown
    SPLIT_STR
    通过 Composer 安装 Laravel 安装器
    laravel Faker-1.faker假数据
    laravel-admin安装时执行php arisan admin:install 命令时报SQLSTATE[42000]: Syntax error or acce ss violation: 1071 Specified key was too long; max key length is 1000 bytes
  • 原文地址:https://www.cnblogs.com/wangjunwei/p/5558749.html
Copyright © 2011-2022 走看看