【转自】http://blog.csdn.net/xysh1991/article/details/8016192

使用方法:进入PowerDesigner,打开一个PDM,在菜单栏找到:Tools – Excute Commands – Edit/Run Script,或者直接按Ctrl+Shift+X调出脚本执行窗口,输入下边的代码就可以了。

下面提供段代码可以把PowerDesigner中的小写字母变为大写字母。 
代码如下: 
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)  
         Dim col ' 要处理的列  
         for each col in Tab.columns  
            '列名称和code全部小写,大写诗UCase  
            col.code= UCase(col.code)  
            col.name= UCase(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

=================================================================================================
下面提供段代码可以把PowerDesigner中的大写字母变为小写字母。 
代码如下: 
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=  LCase(Tab.name)  
        Tab.code= LCase(Tab.code)  
         Dim col ' 要处理的列  
         for each col in Tab.columns  
            '列名称和code全部小写,大写诗UCase  
            col.code= LCase(col.code)  
            col.name= LCase(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

【代码可以就地执行】

【转】PowerDesigner表结构和字段大小写转换的更多相关文章

  1. [转]PowerDesigner表结构和字段大小写转换

    原文地址:https://blog.csdn.net/u010216641/article/details/48712503 ##PowerDesigner去除双引号## 平时经常用PowerDesi ...

  2. Sql中获取表结构(字段名称,类型,长度,说明)

    Sql中获取表结构(字段名称,类型,长度,说明) SELECT TableName = OBJECT_NAME(c.object_id), ColumnsName = c.name, Descript ...

  3. Mysql查询数据库表结构以及字段类型并展示

    1.建表语句sys_user CREATE TABLE `sys_user` ( `id` varchar(32) NOT NULL COMMENT '编号', `dept_id` varchar(3 ...

  4. MySql 、Oracle 获取表结构和字段信息

    1.MySql获取表结构信息 SELECT TABLE_NAME, TABLE_COMMENT FROM information_schema.`TABLES` WHERE TABLE_SCHEMA ...

  5. mysql查看表结构,字段等命令

    mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名;

  6. powerdesigner 字段大小写转换\id 自增

    转换:tools --> model options-->naming convention  name code 自增: 在你所要设为自增型的键上(比如你的id)双击 ,弹出一个Colu ...

  7. SQLServer2005,2000获取表结构:字段名、类型、长度、主键、非空、注释

    SQLServer 2005 SELECT d.name N'TableName', d.xtype N'TableType', a.colorder N'ColumnIndex', a.name N ...

  8. ef codeFirst 修改表结构 增加字段等 EF code first需要重新生成库导致数据丢失的问题.

    需要在库程序包管理器里依次执行以下命令: 1.启用迁移功能:Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDbContext 2.建立 ...

  9. mysql 修改表结构的字段名

    alter table domains  change STATUS  status  tinyint(1)  not null;

随机推荐

  1. c# 判断端口是否被占用

    这里主要用到:命名空间System.Net.NetworkInformation下定义了一个名为IPGlobalProperties的类 具体代码 class PortHelper { #region ...

  2. glusterFS的部署流程

    转自:http://www.cnblogs.com/terrycy/p/5915263.html GlusterFS简单配置   1.准备工作 准备三台机器(物理机或者虚拟机均可)用于安装和测试Glu ...

  3. MySQL必知必会笔记(六)存储过程 游标 触发器

    留印:http://blog.sina.com.cn/s/articlelist_1254871964_5_1.html   第二十三章 使用存储过程     MySQL5 中添加了存储过程的支持. ...

  4. 用 Qt Creator 开发非 Qt 的 C/C++ 程序

    在Windows还是习惯用VS2005但是现在到了Linux下,开发起来C/C++程序就没有那么得心应手的IDE了.虽然很多人推荐E开头那个主要作为Java开发的IDE,不过安上插件后感觉不大好,一个 ...

  5. servlet 转发和超链接转发

    超链接属于客户端跳转,request是无法取得属性的 我们知道一个jsp相当与一个servlet 例如,客户端请求A.jsp页面,在A.jsp页面调用request.getAttribute方法放入属 ...

  6. OOAD和UML

    ooad: object oriented analysis designer 又有两个分支: ooa(object oriented analysis):what to do ood(object  ...

  7. Atom 检测php错误扩展linter-php

  8. 【jQuery】form表单元素序列化为json对象

    序列化form表单元素为json对象: <!Doctype html> <html xmlns=http://www.w3.org/1999/xhtml> <head&g ...

  9. 进程在Linux内核中的角色扮演

    在Linux内核中,内核将进程.线程和内核线程一视同仁,即内核使用唯一的数据结构task_struct来分别表示他们:内核使用相同的调度算法对这三者进行调度:并且内核也使用同一个函数do_fork() ...

  10. 在T-SQL语句中访问远程数据库

    1.启用Ad Hoc Distributed Queries 在使用openrowset/opendatasource前搜先要启用Ad Hoc Distributed Queries服务,因为这个服务 ...