'****************************************************************************** '* File: name2comment.vbs '* Title: Name to Comment Conversion '* Model: Physical Data Model '* Objects: Table, Column, View '* Author: steveguoshao '* Created: 2013-11-29 '* Mod By: '* Modified: '* Version: 1.0 '* Memo: Modify from name2code.vbs '****************************************************************************** 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
在PowerDesigner 使用中设计表结构的时候如果需要将Name列的内容批量同步到对应的字段的comment(注释)列中,则可以用如下设置。
1,打开设计好的E-R 图工程 依次点击工具栏中的【Tools】--->【Excute Commends】---->【Edit/Run Script】 如下图所示:
2,弹出Run/Edit Script 对话框,如下图所示:
3,复制本文开始段代码,保存为name2comment.vbs文件,点击上图工具栏中的第三个“打开文件”按钮,选择刚保存好的脚本文件,如下图所示,点击【Run】按钮,执行脚本
4,关闭窗口,再打开任意一个表设计,会惊喜的发现,列的comment中的内容和Name列的内容一样 了。
相关推荐
PowerDesigner里执行脚本命令,把comment列的内容批量复制到name列。
在PowerDesigner中,可以通过执行脚本来自动化一些重复性任务,例如将字段的名称(Name)自动填充到其注释(Comment)中。以下是对这个过程的详细解释: 首先,打开PowerDesigner,点击菜单栏上的“Tools”(工具)...
PowerDesigner中使name列的值等于comment列的值的脚本,亲测可用
在本篇中,我们将探讨如何使用PowerDesigner批量生成SQL脚本来将name属性转换为数据库中字段的comment。 首先,我们需要了解PowerDesigner中的PDM(Physical Data Model),这是一个物理数据模型,它包含了数据库的...
这是因为 PowerDesigner 中有一个“Name to Code mirroring”功能,该功能可以自动将 Name 同步到 Code 中。 然而,在某些情况下,这种同步功能可能会带来问题。例如,在数据仓库设计中,我们可能需要使用中文字段...
PowerDesigner里执行脚本命令,把name列的内容批量复制到comment列。
PowerDesigner 中把Name值批量复制到Comment实用脚本,注意是在CDM和PDM中运行此脚本便可.PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
根据提供的信息,虽然文章的描述部分为“NULL”,但通过对部分内容的分析,可以看出文章重点介绍了在PowerDesigner中编写和执行脚本,以及如何使用这些脚本进行name和comment的互换。这个过程是通过PowerDesigner的...
描述文件"将Comment中的字符COPY至Name中.vbs"表明这是一个VBScript脚本,用于自动化这个过程。 VBScript是Visual Basic Scripting Edition的缩写,是一种轻量级的脚本语言,常用于Windows环境中的批处理任务。在这...
"PowerDesigner 中name和comment 互换脚本"这个主题涉及到的是在PDM中,如何通过编写VBS(Visual Basic Script)脚本来实现模型对象的name属性和comment属性的交换。 PowerDesigner中的name属性通常用于定义对象的...
这个脚本的作用是将Comment中的字符COPY至Name中。 Step2:然后执行下列脚本: ```vb Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl ' the current model ' get the current active...
在使用PowerDesigner的过程中,有时会遇到一个常见的问题,即Name(名称)与Code(代码)同步的问题。这个问题指的是当用户修改了一个实体或字段的Name时,其对应的Code也会自动更新,这可能不符合开发者的预期,...
标题中的“PowerDesigner 把name写到Comment中 和 把Comment写到name中 pd7以后版本可用”指的是一项在PowerDesigner中操作模型属性的方法。PowerDesigner是一款强大的数据建模工具,广泛应用于数据库设计和逆向工程...
标题“powerdesigner_comment转name_name转comment”指的是使用PowerDesigner工具进行数据库设计时,将字段注释(comment)与字段名(name)之间进行互相转换的功能。在数据库设计过程中,注释对于理解和维护数据库...
首先,我们可以使用一个VBA(Visual Basic for Applications)脚本来将NAME中的字符复制到COMMENT中。这段代码会在当前的CDM或PDM中遍历所有的表、列和视图,并将每个对象的NAME设置为其COMMENT。具体代码如下: ``...
描述中的“PowerDesigner15-将Name中的字符COPY至Comment中.vbs”进一步确认了这个脚本是为PowerDesigner 15版本定制,主要功能就是批量处理模型中的对象,将`Name`字段的内容复制到`Comment`字段。 标签“pdm”...
在实际工作中,有时我们希望PDM中的元素名称能更直观地反映出其功能或含义,这就涉及到将表字段的注释(Comment)转换为PDM中的名称(Name)。 标题中提到的问题,即"PowerDesigner逆向工程时,将表字段的comment...
powerDesigner 把name项添加到comment 使用方法使用方法 PowerDesigner->Tools->Execute Commands->Edit/Run Scripts 可以保存该脚本为:name2comment.vbs
将powerdesigner中物理模型的英文字段名称转换为显示注释
在 PowerDesigner 物理数据模型 (PDM) 中,有时候需要将对象的 Name 复制到 Comment 中,尤其是在数据库生成时不能使用对象名称的情况下(例如,在 PowerDesigner 7 及更高版本中)。这通常是因为数据库生成过程会...