PowerDesigner 将表的字段name属性和comment注释内容互相复制

PowerDesigner-name与comment互相同步 1.使用Powerdesigner工具将pdm文件的name同步至comment。 点击Tools->Execute Commands->Edit/Run Scripts 输入脚本: Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl Set mdl = ActiveModel If (mdl Is Nothing) 阅读详情

一、将name值写入comment

(一)、第一步:编辑vbs脚本:实现将name值写入comment,脚本命名为name2comment.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 

          if  trim(tab.comment)="" then'如果有表的注释,则不改变它.如果没有表注释.则把name添加到注释里面.   
                    tab.comment   =   tab.name   

          end if  
                  Dim   col   '   running   column    
                  for   each   col   in   tab.columns   
                        if trim(col.comment)="" then '如果col的comment为空,则填入name,如果已有注释,则不添加;这样可以避免已有注释丢失.
                           col.comment=   col.name   
                        end if 
                  next    
            end   if    
      next    
  
      Dim   view   'running   view    
      for   each   view   in   folder.Views    
            if   not   view.isShortcut and trim(view.comment)=""  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的工具栏中点击工具-execute commands-edit/run  script

(三):将脚本保存为name2comment.vbs即可。

二、将comment注释复制到name

(一)、编辑vbs脚本:实现将comment注释写入name值,脚本命名为comment2name.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

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

(二) PowerDesigner->Tools->Execute Commands->Edit/Run Scripts运行该脚本即可。

PowerDesigner中使用name生成comment PowerDesigner生成数据库脚本时,code转换为数据库中表名及字段,如果将将PDM中的name(一般为中文名称)转换为comment,则生成数据库备注栏显示name(中文名称),方便程序员的使用。将name转化为comment,可使用以下脚本批量完成。 Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl 'the current model 'get the current a 阅读详情

相关推荐

powerdesigner,将name自动填充到注释(comment)。

PowerDesigner->Tools->Execute Commands->Edit/Run Scripts 将comment覆盖name。 将name自动填充到注释(comment)。

PowerDesigner 把name写到Comment 和 把Comment写到name中

在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或Comment中写中文,在Code中写英文。就可以了,是对整个CDM或PDM进行操作。关闭弹窗后,查看是否把name值复制到Comment中。将代码Copy进去,点击弹窗下方的。以下两段代码都是VB脚本,在。

GSON的博客 988

TSC条码打印机C#例程(tsclib.dll调用) 【转】

//----program.cs using System;using System.Collections.Generic;using System.Windows.Forms; using System.Runtime.InteropServices;public class TSCLIB_DLL{[DllImport("TSCLIB.dll", EntryPoint = "abou...

weixin_33843947的博客 2447

PowerDesigner设计Name和注释相互替换

而设计时候常把comment写成中文,name保留跟code一致,保存完毕后,可以把comment替换到name上。当然也可以用name替换comment。Name是名称(字段描述),Code是字段名称,Comment是注释名称,ER图中显示的是Name。一般设计时,Name跟comment都设计成描述,PowerDesigner设计 设计的表。1 将comment覆盖name。2 将name覆盖comment。3 将code覆盖name。

qq_42209596的博客 1339

Dify实战应用指南(上传需求稿生成测试用例)

摘要: Dify是一款开源大语言模型应用开发平台,通过低代码/无代码方式支持AI应用开发。平台提供五种核心应用类型,包括聊天助手、文本生成、Agent、ChatFlow和Workflow,适用于不同场景。本文以ChatFlow为例,演示如何上传需求稿自动生成测试用例。通过条件分支、文档提取器和LLM设置,实现从需求文档到测试用例的自动化转换,显著提升测试效率并降低人工误差。该方案适用于需要快速生成测试用例的软件开发场景,尤其适合非技术人员使用。

Linda的自动化测试之旅 2751

计算机毕业设计springboot股票模拟交易系统的设计与实现u6m959【附源码+数据库+部署+LW】

选题背景: 随着互联网和金融科技的快速发展,股票市场成为了吸引人们关注和参与的重要领域之一。越来越多的人开始对股票投资感兴趣,希望通过交易股票来获取收益。然而,对于初学者来说,股票市场的复杂性和风险往往让他们望而却步。因此,设计和实现一个股票模拟交易系统,可以帮助初学者更好地理解和掌握股票交易的规则和技巧,提高他们的投资决策能力。 意义: 股票模拟交易系统的设计与实现具有以下几个重要意义: 提供实践机会:股票模拟交易系统为投资者提供了一个实践的平台,使他们能够在真实市场环境下进行模拟交易,了解股票市场的

gp12081的博客 1768

PowerDesigner中NAME和COMMENT的互相转换,需要执行语句

PowerDesigner中NAME和COMMENT的互相转换

liu_yulong的专栏 567

【阿里云大模型高级工程师ACP学习笔记】2.8 部署模型

【摘要】本文主要分享自学阿里云大模型高级工程师 ACP 认证中《2.8 部署模型》的学习笔记。详细介绍学习目标、梳理涵盖的知识点并评估其重要性和难易度,对既重要又困难的知识点进行重点分析,旨在为对阿里云大模型学习和认证感兴趣的读者提供学习思路和经验参考。

davidkorhenn的博客 2063

PowerDesigner中NAME和COMMENT的互相转换

使用说明: 在【Tools】-【Execute Commands】-【Edit/Run Script】 下。输入下面你要选择的语句即可,也可以保存起来,以便下次使用,后缀为.vbs。 需要注意的问题是:运行语句时必须在Module模式下,如果是导出报表时执行会出现错误提示。 1.Name转到Comment注释字段。一般情况下只填写NAME,COMMENT可以运行语句自动生成。 将该语句保存为name2comment.vbs '把pd中那么name想自动添加到comment里面 '如果comment.

cjlcjl的专栏 517

基于STM32的电子琴音乐播放器设计

​ 本设计以实际电路为最后的结果,实现了所有与其功能,具有重要的现实意义。件,在Proteus中进行原理图绘制,然后把 .hex文件下载到STM32F103RBT6中 进行仿真。由于网络上 下载的 Proteus中 没有 STM32F103RBT6这个芯片型号,我们又从网上 下载芯片 进行仿真。​ 本设计以实际电路为最后的结果,实现了所有与其功能,具有重要的现实意义。

TMMXA的博客 2万+

解决在封装自定义IP时加入ila,或者其他ip核时出错的情况

在查阅很多资料后,明白了这个应该是软件bug,但是最终还是解决了问题 我们只需要删除

weixin_42553916的博客 3607

powerdesigner name,comment 互相填充

操作方法:PowerDesigner-->Tools-->Execute Commands-->Edit/Run Scripts ,把以下的脚步复制进行执行就OK了。 脚本如下: 1、把comment 覆盖name 方法如下: Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl ' the current model ' get ...

xingyuncaojun的博客 326

【PowerDesigner】将name和comment注释互相复制

工具栏 Tools(工具) -> Execute Commands -> Edit/Run Script 打开如下对话框 填写如下代码: Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl ' the current model ' get th...

ab102a的博客 415

选择结构试题:编写一个计算机快递费的程序

上海市的某快递公司根据投送目的地距离公司的远近,将全国划分成5个区域:快递费按邮件重量计算,由起重费用、续重费用两部分构成:(1) 起重(首重)1公斤按起重资费计算(不足1公斤,按1公斤计算),超过首重的重量,按公斤(不足1公斤,按1公斤计算)收取续重费;(2) 同城起重资费10元,续重3元/公斤;(3) 寄往1区(江浙两省)的邮件,起重资费10元,续重4元;(4) 寄往其他地区的邮件,起重资费统一为15元。2区的续重5元/公斤,3区的续重6.5元/公斤,4区的续重10元/公斤。

2301_80709334的博客 933

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

使用PowerDesigner对NAME和COMMENT互相转换

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

idays021的专栏 353

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

PowerDesigner--comment和name互相复制

1、comment复制到name 脚本代码: Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl Set mdl = ActiveModel If (mdl Is Nothing) Then ...

weixin_30535843的博客 290

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

powerdesign中comment与name 互相赋值

powerdesigner 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 Msg...

饭饭 479

PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码

         在用PowerDesigner时.常常在NAME或Comment中写中文在Code中写英文.Name只会显示给我们看,Code会使用在代码中.但Comment中的文字会保存到数据库TABLE的Description中,有时候我们写好了Name再写一次Comment很麻烦.以下两段代码就可以解决这个问题. 代码一:将Name中的字符COPY至Comment中  

平淡中求进取,柔和里觅激情 2228

powerdesigner中name和comment转换

原文:   由于PDM 的表中 Name 会默认=Code 所以很不方便, 所以需要将 StereoType 显示到表的外面来 打开[工具]->[显示属性](英文:Display Preferences) ->Content->Table->右边面板Columns框中 勾选: StereoType ,这样再在 StereoType中填入code字段相同内容就会显示在图形界面上了  

fzqlife的博客 691
上一篇: Visio的学习总结
下一篇: oracle的plsql语言学习总结及重点游标
一位远方的诗人
博客等级 码龄10年 174粉丝 262原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一位远方的诗人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值