zoukankan      html  css  js  c++  java
  • Power Designer comment与name互转(vbs脚本)

    分享转载:https://blog.csdn.net/u010216641/article/details/48712503?utm_source=blogxgwz1

    PowerDesigner表结构和字段大小写转换

    操作步骤:

    1)进入PowerDesigner,打开一个PDM,在菜单栏找到:Tools – Excute Commands – Edit/Run Script,然后打开name2comment.vbs脚本;

    2)或者直接按Ctrl+Shift+X调出脚本执行窗口,输入name2content.vbs脚本

    执行代码如下(name2comment.vbs):

    1)name中文复制到comment中文

    Option Explicit  
    ValidationMode = True  
    InteractiveMode = im_Batch  
    Dim mdl ' 当前模型  
    ' 获取当前模型  
    Set mdl = ActiveModel  
    If (mdl Is Nothing) Then  
       MsgBox "没有打开一个模型" 
    ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then  
       MsgBox "当前模型不是一个PDM" 
    Else  
    '调用处理程序  
       ProcessFolder mdl  
    End If    
    '调用的处理程序  
    Private sub ProcessFolder(folder)  
       Dim Tab '要处理的表  
       for each Tab in folder.Tables  
        ' if not Tab.isShortcut then  
            ' Tab.code = tab.name  
            '表名处理,前边添加前缀,字母小写  
            Tab.name= UCase(Tab.name)  
            Tab.code= UCase(Tab.code)  
            tab.comment = tab.name 
             Dim col ' 要处理的列  
             for each col in Tab.columns  
                '列名称和code全部小写,大写诗UCase  
                col.code= UCase(col.code)  
                col.name= UCase(col.name)  
           '列name复制到comment的' col.comment
    = col.name next 'end if next ' 处理视图 ' Dim view 'running view ' for each view in folder.Views ' if not view.isShortcut then ' view.code = view.name ' end if ' next ' 递归进入 sub-packages Dim f ' sub folder For Each f In folder.Packages if not f.IsShortcut then ProcessFolder f end if Next end sub

    2)comment转name中文

    Option Explicit  
    ValidationMode = True  
    InteractiveMode = im_Batch  
    Dim mdl ' 当前模型  
    ' 获取当前模型  
    Set mdl = ActiveModel  
    If (mdl Is Nothing) Then  
       MsgBox "没有打开一个模型" 
    ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then  
       MsgBox "当前模型不是一个PDM" 
    Else  
    '调用处理程序  
       ProcessFolder mdl  
    End If    
    '调用的处理程序  
    Private sub ProcessFolder(folder)  
       Dim Tab '要处理的表  
       for each Tab in folder.Tables  
        ' if not Tab.isShortcut then  
            ' Tab.code = tab.name  
            '表名处理,前边添加前缀,字母小写  
            Tab.name= UCase(Tab.name)  
            Tab.code= UCase(Tab.code)  
            tab.comment = tab.name 
             Dim col ' 要处理的列  
             for each col in Tab.columns  
                '列名称和code全部小写,大写诗UCase  
                col.code= UCase(col.code)  
                col.name= UCase(col.name)  
           '列名comment复制到name上' col.name = col.comment
    next 'end if next ' 处理视图 ' Dim view 'running view ' for each view in folder.Views ' if not view.isShortcut then ' view.code = view.name ' end if ' next ' 递归进入 sub-packages Dim f ' sub folder For Each f In folder.Packages if not f.IsShortcut then ProcessFolder f end if Next end sub
  • 相关阅读:
    Class.getSimpleName()的作用
    win7下制作ubuntu系统安装启动盘和U盘安装ubuntu全过程
    奈奎斯特三大准则
    [转]OFDM中保护间隔和循环前缀抵抗ISI和ICI
    频偏
    移动通信里面,OFDM技术所说的“载波相互正交”是什么意思?
    虚拟盘符映射
    npm 安装与常用命令
    ASP.NET WebAPI HTTPS
    记录下自己写的gulp打包脚本
  • 原文地址:https://www.cnblogs.com/blogslee/p/11611309.html
Copyright © 2011-2022 走看看