PowerDesigner中翻转生成PDM图时把Name属性变成注释(转)

在pd里面运行下面这段代码
‘******************************************************************************
‘* File: name2comment.vbs
‘* Purpose: Database generation cannot use object names anymore
‘ in version 7 and above.
‘ It always uses the object codes.

‘ In case the object codes are not aligned with your
‘ object names in your model, this script will copy
‘ the object Name onto the object comment for
‘ the Tables and Columns.

‘* Title: 把对象name拷入comment属性中
‘* Version: 1.0
‘* 执行方法:PD11 -- Open PDM -- Tools -- Execute Commands -- Run Script
‘******************************************************************************
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 code 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
if tab.comment ="" then
else
tab.name=tab.name+"("+tab.comment+")"
on error resume next
end if
Dim col ‘ running column
for each col in tab.columns
if col.comment="" then
‘ MsgBox "表"+tab.name+"列"+col.name +"没有comment"
else
col.name=col.name+"("+col.comment+")"
on error resume next
end if
next
end if
next
Dim view ‘running view
for each view in folder.Views
if not view.isShortcut then
if view.comment="" then
MsgBox "视图"+view.name +"没有comment"
else
view.name=view.name+"("+view.comment+")"
on error resume next
end if
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-08-26 08:26:57

PowerDesigner中翻转生成PDM图时把Name属性变成注释(转)的相关文章

chart.js插件生成折线图时数据普遍较大时Y轴数据不从0开始的解决办法[bubuko.com]

chart.js插件生成折线图时数据普遍较大时Y轴数据不从0开始的解决办法,原文: 默认情况下如下图 Y轴并不是从0开始,这样折现图的幅度会很大,不是正常的幅度,解决办法如下, 示例代码: window.onload = function () { var ctx = document.getElementById("canvas").getContext("2d"); window.myLine = new Chart(ctx).Line(lineChartDat

PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法

1 PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法如下, 依次打开Tools -- Execute Commands -- Run Script,运行以下脚本: Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl 'the current model 'get the current active model Set mdl = ActiveModel

Powerdesigner数据库反向生成PDM显示中文

Tools->Execute Commands->Edit/Runscript- 执行以下脚本,在Powerdesigner从数据库反向生成PDM时,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

在PowerDesigner中自动生成sqlserver字段备注

PowerDesigner是数据库设计人员常用的设计工具,但其自生默认生成的代码并不会生成sqlserver数据库的字段备注说明.在生成数据库后还需要手工修改,比较麻烦. 先介绍一种办法,直接由PowerDesigner自动生成sqlserver的备注字段. 1.在PowerDesigner中建立好物理模型后 2.在PowerDesigner中选择工具——>Execute Commends——>Edit/Run Script,打开如下对话框: 3.在对话框中输入如下代码: Option Exp

Powerdesigner中如何生成测试数据

设计表完成以后,我们需要生成一些测试数据,可以直接更新到数据库中,下面我们就来试试: 第一步:建立需要的Profiles测试文件,[Model]--[Test Data Profiles],如图所示: 第二步:则打开属性窗口,如图所示,下面要进行详细的介绍了 选择不同数据来源,则Detail选项卡是不一样的, 数据类型有三种:NUMBER,Character,DATA三种类型,因为一般情况下数据类型也只有这三种类型. 数据来源有四种: Automatic 自动生成测试数据: List 利用测试数

C#中如何生成矢量图

主要的功能就是使用C#画矢量图,然后导出到Word.Excel.Powerpoint中,并且能够再次被编辑.以下是解决过程: 首先应该确定在Office文档中可编辑图形使用的格式:学习了相关资料,了解到Office文档主要支持三种矢量图的格式:1.VML图形,2.WMF文件格式,3.EMF文件格式.由于VML图开一般使用HTML语言进行描述,不便于进行操作,因此决定采用WMF和EMF文件格式. 接下来的工作就是要让C#根据提供的数据生成WMF或EMF格式的矢量图形:学习了C#提供的GDI+绘图类

PowerDesigner连接 MySQL 生成 ER图

powerdesigner 16.5 http://www.pcsoft.com.cn/soft/27495.html jdk 1.8 32位 https://mirrors.huaweicloud.com/java/jdk/8u151-b12/jdk-8u151-windows-i586.exe mysql 链接库 https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.47.zip File->Reverse

在powerDesigner中通过SQL生成pdm

在项目需求分析的阶段,通常需要画数据库表的pdm图.有时候会直接画pdm来设计表,有时候是通过其他方式,如用纸和笔去画……当数据库中的表已经建立好了,怎么把数据库中的表导成SQL形式,然后生成pdm图呢? 数据库:oracle.数据库工具:dbVisual ①在dbVisual中可以连接各种数据库,这里连接oracle数据库,用的也是dbVisual.在dbVisual中,ctrl选择多个要生成pdm的表,右击,导出SQL形式,生成导出的SQL文件. ②打开powerDesigner, File

PD逆向工程从现有数据库生成PDM

Powerdesigner  版本16.5 在Powerdesigner中逆向生成 1,打开Powerdesigner工具,创建一个PDM文件,选择与之匹配的数据库类型“SqlServer2012”. 创建方法为:右键点击左侧面板中的WorkSpace---->new------>physical data nodel  ,在DBMS中选择你要的数据类型,选择好后点击确定,则新建立了一个工作空间. 2,配置个数据连接 3,选择Database菜单下的uodate mode from datab