powerdesigner中把表的描述复制到Name
- '******************************************************************************
- '* File: comment2name.vbs
- '* Author: Jason Chen
- '* Created: 2014
- '* Modified: 2017/6
- '* Version: 2.0
- '* Comment: 把表中的描述信息复制为Name,增强可读性
- '* Used: 打开物理模型,运行本脚本(Ctrl+Shift+X)
- '* 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
- 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.code & " " & tab.comment
- Dim col ' running column
- for each col in tab.columns
- if col.comment="" then
- else
- dim colComment
- colComment = col.comment
- dim index
- dim indexArray(9) '排除掉"X"后的文本
- indexArray(0) = InStr(colComment, ":")
- indexArray(1) = InStr(colComment, vbcrlf)
- indexArray(2) = InStr(colComment, ":")
- indexArray(3) = InStr(colComment, "(")
- indexArray(4) = InStr(colComment, "【")
- indexArray(5) = InStr(colComment, "[")
- indexArray(6) = InStr(colComment, "(")
- indexArray(7) = InStr(colComment, ",")
- indexArray(8) = InStr(colComment, " ")
- index = getArrMinValueIndex(indexArray)
- if index > 0 then
- Output index
- colComment = Mid(colComment, 1, index-1)
- end if
- col.name = colComment
- end if
- next
- end if
- next
- Dim 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
- '查找最近一个匹配的字符
- Function getArrMinValueIndex(ByVal arr)
- Dim ix, itemMin
- itemMin = 0
- For ix = 1 To UBound(arr)
- If arr(ix) > 0 and (itemMin = 0 or itemMin > arr(ix)) Then
- itemMin = arr(ix)
- End If
- Next
- getArrMinValueIndex = itemMin
- End Function
powerdesigner中把表的描述复制到Name的更多相关文章
- SQL SERVER 将一个数据库中的表和数据复制到另一个数据库中
第一种情况:将A数据库.dbo.A表的数据追加到B数据库.dbo.B表中 (条件:此时B数据库中已创建好了B表) insert into B数据库.dbo.B表 select * from A数据库. ...
- 反向读取Mysql数据库表结构到PowerDesigner中
使用PowerDesigner挺长时间了,只是一些简单的表结构设计,因需要对当前数据库进行再设计,需要看一下数据库中所有的表,及表之间的关系,并重新修改表结构,因此需求就是怎么把数据库中的表结构反向生 ...
- 使用PowerDesigner创建物理模型并生成SQL语句在MySQL中生成表
我使用的PowerDesigner的版本为16.5,创建物理模型后,使用PowerDesigner生成的SQL语句,在MySQL中创建表. 1. 打开Power Designer软件,在弹出的欢迎对话 ...
- sql 2012中获取表的信息,包含字段的描述
1.获取数据库中的表 select name from sysobjects where type='U' 2.获取表字段(此处是Route表) Select name from syscolumns ...
- python生成数据库中所有表的DESC描述
在数据库设计完成之后, 常常需要在 wiki 或其他文档中保存一份数据库中所有表的 desc 描述, 尤其是每个字段的含义和用途. 手动去生成自然是不可取的. 因此, 我编写了一个简单的 python ...
- PowerDesigner中创建Oracle表全过程记录
本文记录如何在PowerDesigner中创建一个Oracle结构的表. 在进行本文阅读之前,需要在PowerDesigner进行 DBMS修改,DataBase创建,用户创建,表空间创建. 1. ...
- PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法
1 PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法如下, 依次打开Tools -- Execute Commands -- Run Script,运 ...
- oracle 表导入到powerDesigner 中
最近不忙,之前一直是用powerDesigner看表结构,还没自己导入过,今天试试 oracle 表导入到powerDesigner 中步骤: 1.File--->reverse Enginne ...
- 利用脚本将EXCEl表倒入PowerDesigner中
1.Excel表格样式 2.脚本代码 '****************************************************************************** O ...
随机推荐
- 直接抱过来dd大牛的《背包九讲》来做笔记
P01: 01背包问题 题目 有N件物品和一个容量为V的背包.第i件物品的费用是c[i],价值是w[i].求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大. 基本思路 这是最 ...
- Android:有关菜单的学习(供自己参考)
Android:有关==菜单==的学习 上下文菜单 上下文菜单就是手机中对某一项进行==点击一定时间==后弹出的针对该项处理的菜单. context_menu.xml: <?xml versio ...
- 团队作业the end
GitHub 王德钊 李镇平 陈启昌 黄益颂 汪倍民 演示动态图:为避免现场演示翻车,各个团队需要给出项目各个功能点运行的git图. 还在肝: 分工协作:团队的成员如何分工协作的?对项目的贡献如何(用 ...
- 团队Alpha冲刺(六)
目录 组员情况 组员1(组长):胡绪佩 组员2:胡青元 组员3:庄卉 组员4:家灿 组员5:凯琳 组员6:翟丹丹 组员7:何家伟 组员8:政演 组员9:黄鸿杰 组员10:刘一好 组员11:何宇恒 展示 ...
- 福大软工1816:Alpha事后诸葛
福大软工·第十一次作业-Alpha事后诸葛亮 组长博客链接 本次作业博客链接 项目Postmortem 模板 设想和目标 我们的软件要解决什么问题?是否定义得很清楚?是否对典型用户和典型场景有清晰的描 ...
- 搜索引擎Elasticsearch,了解一下?
ElasticSearch介绍 ElasticSearch是一个全文搜索服务器,也可以作为NoSql数据库,存储任意格式的文档和数据,同时可以做大数据的分析.ElasticSearch具有以下特点: ...
- IBM存储降级告警等一些服务器问题/dd/ethtool
1.IBM存储降级告警 一般两种情况 a.端口降级 例如模块16G->8G(IBM储存端口自适应) b.系统在作raid后,有硬盘损坏,降级 黄灯告警 2. dimm error dimm内存插 ...
- 【final】Scrum站立会议第2次....11.20
小组名称:nice! 组长:李权 成员:于淼 刘芳芳韩媛媛 宫丽君 项目内容:约跑app(约吧) 时间:2016.11.9 12:00——12:30 地点:传媒西楼220室 本次对fnal阶段 ...
- (六)hadoop系列之__hadoop分布式集群环境搭建
配置hadoop(master,slave1,slave2) 说明: NameNode: master DataNode: slave1,slave2 ------------------------ ...
- 对mysql联合索引中的字段进行合理排序
在MySQL的where条件中,有时会用到很多的条件,通常为了加快速度会把这些字段放到联合索引中,可以更快的提高搜索速度: 但是对联合索引中字段顺序的合理排序,便更能提高速度 例子:select * ...