powerdesigner导出sql将name放到comment注释上

1. 批量设置

2. 脚本

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

3. 结果

好了

4. 生成sql

相关推荐
cui_ruicheng4 小时前
LangChain 应用开发(十四):Agent 上下文与记忆机制
服务器·人工智能·python·langchain
润乾软件4 小时前
SQLazy:分组累计求和
sql·sqlazy
倔强的石头_5 小时前
连接数失控排查:从数据库会话、应用线程池到连接池泄漏
数据库
hzxpaipai5 小时前
企业官网技术架构拆解:前端、后台、数据库、服务器如何协同
前端·数据库·架构
爱吃火鸡面呀6 小时前
MySQL DQL 子查询详解:从标量、列、行到表子查询的完整实战
大数据·数据库·mysql
harmony&7 小时前
OpenStack 云平台管理实战:从 Keystone 认证到 Nova 计算调度
数据库·openstack
Brilliantwxx7 小时前
【Linux】 进程(10) 进程控制深度解析:创建、终止与等待
linux·运维·服务器·c语言·开发语言·网络
betazhou7 小时前
Apache Seatunnel 抽取Oracle数据库测试
数据库·oracle·apache·seatunnel
ai小陈7 小时前
FramePack图生视频云端部署实战:从单图输入到视频输出的完整流程
服务器·人工智能·安全·ai·音视频·gpu算力
欧米欧8 小时前
Linux基础指令上
linux·运维·服务器