这两天在用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 替换的更多相关文章

  1. PowerDesigner设计的数据库 ORA-0092

    异常 数据库由Powerdesigner设计,格式为Oracle10g,由Powerdesigner生成的数据库并没报什么异常,使用navicat也能正常操作,而使用PLSQL Developer去出 ...

  2. PowerDesigner 设计数据库中常用脚本

    PowerDesigner 设计数据库中常用脚本 数据库设计 物理模型设置 Name转Comment脚本 '********************************************** ...

  3. 使用PowerDesigner设计建造MySQL数据库

    使用PowerDesigner设计建造MySQL数据库 一.使用PowerDesigner制作建库脚本 1.设计CDM(Conceptual Data Model) 2.选择 Tools -> ...

  4. 对象的继承关系在数据库中的实现方式和PowerDesigner设计

    原文:对象的继承关系在数据库中的实现方式和PowerDesigner设计 在面向对象的编程中,使用对象的继承是一个非常普遍的做法,但是在关系数据库管理系统RDBMS中,使用的是外键表示实体(表)之间的 ...

  5. 使用PowerDesigner 设计SQL Server 数据库

    工具: Sybase PowerDesigner 12.5 Microsoft  SQL Server 2005 第一步:概念数据模型 打开PowerDesigner 软件,设计“概念数据模型”(Co ...

  6. 新手学习数据库(一)用Powerdesigner设计数据库

    说明: 一.学会用开发语言进行数据库编程,其关键是在于学会sql语言,开发语言只不过给程序员提供了一个操作数据库的接口罢了. 二. 本人也是初学者,采用的数据库设计软件是powerdesigner.利 ...

  7. 采用PowerDesigner 设计数据库

    PowerDesigner设计数据库的教程网上都有,最好的是我一位同学写的,地址: 点击这里 我的大致流程如下: 首先要以管理员的身份打开PowerDesigner,如果没这么做,将导致后面无法创建S ...

  8. powerdesigner设计的pdm模型导出清晰图片格式

    用powerdesigner设计了数据库模型,想把模型粘贴到数据库文档中,之前一直是Ctrl+A然后复制,直接粘贴过去的,这次领导说放大看不清,o(╯□╰)o 没办法,得搞个高清图复制上去啊,怎么办呢 ...

  9. PowerDesigner设计表时显示注释列Comment,Columns中没有Comment的解决办法

    我使用的PowerDesigner版本为16.5,如下图: 在所要编辑的表上双击,打开Table Properties窗口,并将上面的选项卡切换到Columns,如下图: 我们点击Customize ...

随机推荐

  1. JS检测移动端横竖屏

    (function () {                                var supportOrientation = (typeof window.orientation == ...

  2. 包管理工具Carthage使用

    iOS项目中第三方开源库的工具有Cocoapods和Carthage,swift官方出了一个包管理工具SPM(Swift Package Manager). 首先,大体讲一下Cocoapods和Car ...

  3. 快速将一个表的数据生成SQL插入语句

    将一个表中的数据生成SQL插入语句,方便系统快速初始化,在数据库中执行创建以下过程就可以了. ) Drop Procedure GenerateData go CREATE PROCEDURE Gen ...

  4. Python学习笔记(一)python基础与函数

    1.python基础 1.1输入与输出 输出 用print加上字符串,就可以打印指定的文字或数字 >>> print 'hello, world' hello, world > ...

  5. 基于HTML5和JS实现的切水果游戏

    切水果游戏曾经是一款风靡手机的休闲游戏,今天要介绍的就是一款网页版的切水果游戏, 由JavaSript和HTML5实现,虽然功能和原版的相差太大,但是基本的功能还是具备了,还是模仿的挺逼真,有一定的J ...

  6. Linux 下应用程序最大打开文件数的理解和修改

    运行在Linux系统上的Java程序运行了一段时间后出现"Too many open files"的异常情况. 这种情况常见于高并发访问文件系统,多线程网络连接等场景.程序经常访问 ...

  7. c# unchecked关键字。byte 合并short

    参考MSDN 代码: public class BytesOperate { /// <summary> /// 计算校验和,SUM /// </summary> public ...

  8. LuaSrcDiet工具介绍(lua源码处理软件)

    Diet Food Diet (nutrition), the sum of the food consumed by an organism or group Dieting, the delibe ...

  9. Eclipse中配置svn

    1.打开eclipse,help--> Eclipse MarketPlace...,搜索输入“subclipse”,点击安装,一路按向导安装: 2.安装成功后,在Window --> S ...

  10. 在线免费生成 <IDEA>全系列 注册码

    body { background: #fff; color: #333; font-family: Consolas, sans-serif; margin: 2em auto; width: 70 ...