powerdesigner 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

  

时间: 2024-12-22 23:05:00

powerdesigner name->comment 脚本的相关文章

去掉PowerDesigner生成SQL脚本中字段名带的引号

使用PowerDesigner生成数据库建表SQL脚本时,尤其是Oracle数据库时,表名一般会带引号.其实加引号是PL/SQL的规范,数据库会严格按照""中的名称建表,如果没有"",会按照ORACLE默认的设置建表(DBASTUDIO里面),默认是全部大写,这样,在ORACLE数据库里的字段就如"Column_1".如果你把引号去掉,ORACLE自动默认为全部大写,即"COLUMN_1",所以这段SQL在PL/SQL中执行的

PowerDesigner 把Comment写到name中 和把name写到Comment中 pd7以后版本可用

在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或Comment中写中文,在Code中写英文.Name用来显 示,Code在代码中使用,但Comment中的文字会保存到数据库Table或Column的Comment中,当Name已经存在的时候,再写一次 Comment很麻烦,可以使用以下代码来解决这个问题: 代码一:将Name中的字符COPY至Comment中 Option   Explicit ValidationMode   =   True Intera

转-PowerDesigner 把Comment复制到name中和把name复制到Comment

在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或Comment中写中文,在Code中写英文.Name用来显 示,Code在代码中使用,但Comment中的文字会保存到数据库Table或Column的Comment中,当Name已经存在的时候,再写一次 Comment很麻烦,可以使用以下代码来解决这个问题 在PowerDesigner中使用方法为: PowerDesigner->Tools->Execute Commands->Edit/Run Scr

PowerDesigner 把Comment复制到name中和把name复制到Comment

在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或Comment中写中文,在Code中写英文.Name用来显 示,Code在代码中使用,但Comment中的文字会保存到数据库Table或Column的Comment中,当Name已经存在的时候,再写一次 Comment很麻烦,可以使用以下代码来解决这个问题 在PowerDesigner中使用方法为: PowerDesigner->Tools->Execute Commands->Edit/Run Scr

PowerDesigner导入SQL脚本

打开PowerDesigner,鼠标单击File菜单: 选择:Reverse Enginer,然后在他的子菜单选择Database...; 选择好DBMS(数据库管理系统)类型:然后点击确定按钮:这里演示选中的是mysql数据库,具体类型根据自己需要选择: 点击Add  Files 图标添加脚本: 找到要导入的sql脚本,鼠标单击打开按钮: 鼠标单击,确定按钮: 开始反向工程生成数据库..... 导入成功!

利用VBA把PowerDesigner的comment复制到name

代码如下: Option Explicit '------------------------------------------------------------------------------- '作用:PowerDesigner物理模型复制comment到name ' '作者: 王国狮 ' '时间: 2015-12-18 ' '版本: V1.0 ' '注意:如果name有值,将会覆盖:可以重复执行,不会多次复制 '-----------------------------------

PowerDesigner生成sql脚本

1.打开PowerDesigner->New Project; 2.填写项目名称,选择文件的存放路径: 3.新建一个模型,New Model: 4.选择概念模型,填写模型名称: 5.选择entity,创建实体模型: 6.点击模型图,填写表结构信息: 时间类型的数据格式说明: 对于创建过程中出现相同字段的情况处理: 更改前: 更改后: 7.将表结构创建完成后,进行表之间的关联,点击relationship将表与表直接关联起来: 选择表与表之间的关系: 8.生成物理模型图: 选择数据库类型 软件会自

PowerDesigner生成SQL脚本时,对象带有双引号的问题解决

在pdm查看脚本时,发现表名和字段名带有双引号: 1.create table"cfg_user_card_account"  ( 2.  "user_card_account_id" number                          not null, 3.  "dat_user_id"       NUMBER, 4.  "user_balance"       number, 5.  "user_

如何使用powerdesigner将数据脚本导成html格式

1.点击file->reverse engineer->database... model name 随便写(列入mymodel) dbms选择你的数据库脚本类型(我的是 sql server 2008)点击确定. 2.数据库表生成完成 3.新建一个模板,点击report->report template 显示 选择language语言 然后选择模板 physical data model 点击确定. 在左侧选择要显示的信息  list of table(表列表)  和 list of

PowerDesigner导出mysql脚本

打开使用MySQL5.0的PDM之后,在菜单里选择Database->Edit Current DBMS.. 确认DBMS使用的是MySQL5.0 打开左端树状结构Script->Objects->View 选中Create,在右端的Value中写入 create VIEW [%R%?[ if not exists]] %VIEW% as %SQL% 选中Drop,在右端的Value中写入 drop table if exists %VIEW% 选中Enable,在右端的Value中选择