PowerDesigner设计Name和Comment 替换
这两天在用powerdesigner设计数据库。一直以为name就是注释名字来着。后来生成sql语句 怎么就没有注释信息那。 后来看了半天才知道自己范2了。
通过各种信息查找。大多都是改database下的edit current DBMS 里面的东西。但是这样生成出来 不能直接执行。 自己琢磨半天。又查了查资料终于找到了。
comment 是注释。name 是字段描述
在 PowerDesigner中操作如下
PowerDesigner-->Tools-->Execute Commands-->Edit/Run Scripts 下执行就OK了
。
执行代码--------------------------------
把comment 覆盖name 方法如下:
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
Dim mdl ' the current model
' get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model "
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model. "
Else
ProcessFolder mdl
End If
Private sub ProcessFolder(folder)
On Error Resume Next
Dim Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
tab.name = tab.comment
Dim col ' running column
for each col in tab.columns
if col.comment="" then
else
col.name= col.comment
end if
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.name = view.comment
end if
next
' go into the sub-packages
Dim f ' running folder
For Each f In folder.Packages
if not f.IsShortcut then
ProcessFolder f
end if
Next
end sub
将name覆盖comment 方法如下
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
Dim mdl ' the current model
' get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model "
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model. "
Else
ProcessFolder mdl
End If
' This routine copy name into comment for each table, each column and each view
' of the current folder
Private sub ProcessFolder(folder)
Dim Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
tab.comment = tab.name
Dim col ' running column
for each col in tab.columns
col.comment= col.name
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.comment = view.name
end if
next
' go into the sub-packages
Dim f ' running folder
For Each f In folder.Packages
if not f.IsShortcut then
ProcessFolder f
end if
Next
end sub
完事。 自己纠结了好久。 终于解决了 自己留个纪念。
将comment覆盖name
PowerDesigner设计Name和Comment 替换的更多相关文章
- PowerDesigner设计的数据库 ORA-0092
异常 数据库由Powerdesigner设计,格式为Oracle10g,由Powerdesigner生成的数据库并没报什么异常,使用navicat也能正常操作,而使用PLSQL Developer去出 ...
- PowerDesigner 设计数据库中常用脚本
PowerDesigner 设计数据库中常用脚本 数据库设计 物理模型设置 Name转Comment脚本 '********************************************** ...
- 使用PowerDesigner设计建造MySQL数据库
使用PowerDesigner设计建造MySQL数据库 一.使用PowerDesigner制作建库脚本 1.设计CDM(Conceptual Data Model) 2.选择 Tools -> ...
- 对象的继承关系在数据库中的实现方式和PowerDesigner设计
原文:对象的继承关系在数据库中的实现方式和PowerDesigner设计 在面向对象的编程中,使用对象的继承是一个非常普遍的做法,但是在关系数据库管理系统RDBMS中,使用的是外键表示实体(表)之间的 ...
- 使用PowerDesigner 设计SQL Server 数据库
工具: Sybase PowerDesigner 12.5 Microsoft SQL Server 2005 第一步:概念数据模型 打开PowerDesigner 软件,设计“概念数据模型”(Co ...
- 新手学习数据库(一)用Powerdesigner设计数据库
说明: 一.学会用开发语言进行数据库编程,其关键是在于学会sql语言,开发语言只不过给程序员提供了一个操作数据库的接口罢了. 二. 本人也是初学者,采用的数据库设计软件是powerdesigner.利 ...
- 采用PowerDesigner 设计数据库
PowerDesigner设计数据库的教程网上都有,最好的是我一位同学写的,地址: 点击这里 我的大致流程如下: 首先要以管理员的身份打开PowerDesigner,如果没这么做,将导致后面无法创建S ...
- powerdesigner设计的pdm模型导出清晰图片格式
用powerdesigner设计了数据库模型,想把模型粘贴到数据库文档中,之前一直是Ctrl+A然后复制,直接粘贴过去的,这次领导说放大看不清,o(╯□╰)o 没办法,得搞个高清图复制上去啊,怎么办呢 ...
- PowerDesigner设计表时显示注释列Comment,Columns中没有Comment的解决办法
我使用的PowerDesigner版本为16.5,如下图: 在所要编辑的表上双击,打开Table Properties窗口,并将上面的选项卡切换到Columns,如下图: 我们点击Customize ...
随机推荐
- ZTE交换路由设备配置的备份与恢复
一.TFTP服务器搭建 使用用户计算机搭建TFTP服务器,交换路由设备作为TFTP客户端. 运行TFTPServer.exe,该程序所在的目录为TFTP的根目录. 请保证您的TFTP可以Ping通所要 ...
- JSP数据交互
JSP数据交互 一.jsp中java小脚本 1.<% java代码段%> 2.<% =java表达式%>不能有分号 3.<%!成员变量和函数声明%>二.注释 1 ...
- ORM系列之二:EF(4) 约定、注释、Fluent API
目录 1.前言 2.约定 2.1 主键约定 2.2 关系约定 2.3 复杂类型约定 3.数据注释 3.1 主键 3.2 必需 3.3 MaxLength和MinLength 3.4 NotMapped ...
- 项目在vs中打开后识别不出来ashx页面的解决方法
在web.config配置文件中指定页面版本 <add key="webPages:Version" value="2.0"/> <?xml ...
- oracle not in,not exists,minus 数据量大的时候的性能问题
http://blog.csdn.net/greenappple/article/details/7073349/ 耗时 minus<not exists<not in
- asio制作使用ssl通信的证书
1,生成ca的keyopenssl genrsa -out ca.key 1024/2048 (with out password protected) openssl genrsa -des3 -o ...
- equals == 比较
public class Equals{ public static void main(String[] args){ Interger n1=new Interger(47); Interger ...
- npm总结
1.npm install -g 模块 全局安装 2.npm install 模块@version 安装具体摸个版本的模块 ...
- 关于sql优化的一个小总结
1.数据量大的时候,可以分多次查询2.有些数据的存储可以分主次表,此表存一些不常用的数据3.union all 比union效率要高4.尽量不要用distinct5.不返回不需要的行和列6.根据条件加 ...
- centos7优化内核参数详解
cat /etc/sysctl.conf #CTCDN系统优化参数 #关闭ipv6 net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.d ...