使用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) 阅读详情

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

在PowerDesigner中使用方法为:
PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
将代码Copy进去执行就可以了,是对整个CDM或PDM进行操作。

代码一:将Name中的字符COPY至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

另外在使用REVERSE ENGINEER从数据库反向生成PDM的时候,PDM中的表的NAME和CODE事实上都是CODE,为了把NAME替换为数据库中Table或Column的中文Comment,可以使用以下脚本:

代码二:将Comment中的字符COPY至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

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导出sql将name放到comment注释上

【代码】powerdesigner导出sql将name放到comment注释上。

weixin_45947759的博客 1351

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

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

GSON的博客 988

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

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

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

Windows服务器渗透必备:5款杀软在线识别平台实测对比(附避坑指南)

本文针对Windows服务器渗透测试中的关键环节,实测对比了五款主流的在线杀软识别平台。文章从实战场景出发,深入分析了各平台在识别准确率、响应速度、隐匿性及使用风险上的差异,并提供了详尽的避坑指南与高级隐匿技巧,旨在帮助安全人员快速、精准地识别目标环境安全防护,为后续行动奠定情报基础。

weixin_29322553的博客 433

基于Ventoy制作单个U盘引导Windows+Linux+黑苹果macOS

一款国内高手开发的一个名为Ventoy的开源多系统启动U盘制作工具,官方链接:https://www.ventoy.net/cn/index.html Ventoy 特点 不影响U盘日常普通使用 直接从ISO文件启动,无需解开 支持MBR和GPT分区格式(1.0.15+) 支持超过4GB的ISO文件 支持大部分常见操作系统, 已测试650+ 个ISO文件 不仅仅是启动,而是完整的安装过程 版本升级时数据不会丢失 Ventoy 待改进 不支持macOS和ChromeOS 准备2个空的U.

wybarcelona的博客 3万+

PowerDesigner通过SQL语句生成PDM文件并将name和comment进行互相转换

本篇文章主要介绍了PowerDesigner通过SQL语句生成PDM文件并将name和comment进行互相转换 超详细过程(图文),具有一定的参考价值,感兴趣的小伙伴们可以参考一下 1.软件准备 软件:Navicat 11.1,Powerdesigner 15 2.安装步骤 第一步:将要生成的数据库导出为sql文件 第二步:打开PowerDesigner选择File--&gt...

weixin_30758821的博客 644

SAP数据导入工具(LSMW) 超级详细教程(批量导入内部订单)

用户提了个需求,让我批量导入内部订单几百个内部订单。我本打算用写段ABAP 代码来调用 BAPI (BAPI_INTERNALORDER_CREATE)就可以了。但想到我很久没有用过LSMW 了,都快要忘记了。于是我采用LSMW的方式,完成了任务。并把过程记录下来,形成教程方便我以后回头查看,分享出来也希望对大家有帮助。

IT小职员 2万+

PowerDesigner中 脚本实现name与comment互相转换

PowerDesigner中name与comment互相转换脚本。 powerdesigner 逆向工程时,总需要将注释转为name值。 PowerDesigner中通过脚本将name赋值到comment。 PowerDesigner中通过脚本将comment赋值到name。

白衣若尘的博客 1034

BERT之提取特征向量 及 bert-as-server的使用

本文内容列表提取句向量1、句向量简介1-1传统句向量1-2、BERT句向量2、 extract_features.py源码分析2-1 main函数 前一篇文章 BERT介绍及中文文本相似度任务实践 简单介绍了使用BERT进行中文文本相似度计算的方法,这篇文章着重对特征提取方法进行讲述。 提取句向量 1、句向量简介 1-1传统句向量 更多采用word embedding的方式取加权平均,该方法的一大...

ling620的专栏 1万+

SCU【C】程序设计基础期末安全项目lab2-Deadbeef-writeup(附题目&源码)

项目名称(本质:栈溢出攻击)【源码在文首】和lab1一样,此题又是美国卡耐基梅隆大学的平时作业哈哈哈! 项目要求是把栈溢出,强行更改函数返回值,输出0xdeadbeef。

2301_79586491的博客 1544

PowerDesigner中NAME和COMMENT的互相转换

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

cjlcjl的专栏 517

threejs加载3dtiles(倾斜摄影)数据

1、安装3dTilesRenderer 插件 使用npm 安装 npm install 3d-tiles-renderer --save 或者去官网下载都行 GitHub - NASA-AMMOS/3DTilesRendererJS: Renderer for 3D Tiles in Javascript using three.js 2、使用 首先引入,在填入3dtiles数据的地址,可以是文件路径也可以是网站路径 const tilesRenderer = new TilesRend..

weixin_39481659的博客 1万+

PowerDesigner Name 和 Comment 的互相转换

【代码】PowerDesigner Name 和 Comment 的互相转换。

2301_76636891的博客 743

GEE必须会教程——一文教会你研究区域分块计算与合并

一整块算不是挺好的吗?emmmm,用过的人都知道,GEE好比幼年期的“紫妍”,要用“丹药”来养的,除非你是萧炎小友,到哪都有人给爆金币。我们今天想做的是计算2020年夏季西藏自治区的植被覆盖度(FVC),FVC的估算需要使用归一化植被指数(NDVI数据),这里我们用到的产品是MODIS的相关数据产品,该产品的分辨率是25 0m。下载好的结果毕竟是一块一块的,怎么对下载好的结果进行拼接,变成一张大图呢,别急,接下来,我们上科研小霸王——R语言。此处,我们通过省份数据,按照属性筛选,得到西藏自治区的行政边界。

Promising_GEO的博客 2510

【AI智能体】Codex 生成高质量电商套图实战操作详解

Codex 生成高质量电商套图实战操作详解

congge 4510

pdm-name和comment的互相同步

1.使用Powerdesigner工具将pdm文件的name同步至comment。 点击Tools->Execute Commands->Edit/Run Scripts 输入脚本: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...

yangyongming_888的博客 869

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

上一篇: W10左上角为什么显示声音音量框,同时会遮挡屏幕,如何解决?
下一篇: excel生成oracle sql语句
小码农大厂梦丶
博客等级 码龄11年 6粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值