PowerDesigner导出SQL时自动生成注释
在powerBuilder中新建一个Physical Data Model,在其中新建一个用户表,信息如下图所示:

此时的SQL语句可从其中的Preview视图中得到,如下图所示:

这个时候生成的sql语句是没有注释的,而且sql语句可能也不是适合自己所对应的数据库语言。此时可以通过以下方法来生成注释并且选择所需的数据库语言。
1、为sql生成注释,操作如下,我用的是PowerDesigner12.5,在其中选择Tools----》Excute commands-----》Edit/Run Script打开的窗口中添加以下信息
'******************************************************************************
'* File: name2comment.vbs
'* Purpose: Database generation cannot use object names anymore
' in version 7 and above.
' It always uses the object codes.
'
' In case the object codes are not aligned with your
' object names in your model, this script will copy
' the object Name onto the object Comment for
' the Tables and Columns.
'
'* Title:
'* Version: 1.0
'* Company: Sybase Inc.
'****************************************************************************** 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
'把列name和comment合并为comment
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
点击run后,可以看到刚刚的preview视图窗口中已经如下图所示

2、更换数据库sql语句。
选择Database---》change current DBMS,在DBMS中选择对应的数据库,如Microsoft SQL Server 2005,点击确定后,然后选择Database---》Generate Database选项,在弹出的窗口中选择生成sql文件的保存路径,点击确定,则可看到生成的sql语言完全是按照sqlserver2005的标准。
PowerDesigner导出SQL时自动生成注释的更多相关文章
- eclipse 新建 java 文件时自动生成注释
http://blog.csdn.net/kimsoft/article/details/5337910 Windows->Preference->Java->Code Style- ...
- PowerDesigner16导出SQL时如何添加注释
添加注释方法 https://jingyan.baidu.com/article/47a29f24652e44c0142399c3.html 重点是修改value的值 alter table [%QU ...
- powerdesigner导出SQL时大写转换
打开物理模型,点击菜单“Tools->Execute Commands -> Edit/Run Script...",或者快捷键(Ctrl+Shift+X)执行下面vbscrip ...
- powerdesigner 不能自动生成注释的解决方法(三步解决)
解决power designer 不能自动生成注释的解决办法只需要3步: 一.快捷键 Ctrl+Shift+X 打开脚本编辑器:(快捷键不能执行的话可以从这个路径执行:Tools --> Exc ...
- powerdesigner 不能自动生成注释的解决方法
解决power designer 不能自动生成注释的解决办法只需要3步: 一.快捷键 Alt+Shift+X 打开脚本编辑器: 二.将下面天蓝色的字体脚本添加到脚本编辑器里面: Option Expl ...
- webstorm创建js文件时自动生成js注释
设置webstorm创建js文件时自动生成js注释 settings--Editor--File and Code Temlates 黑色框框里的内容自己填写上去,以下是参考的代码块: /** * @ ...
- 解决power designer 不能自动生成注释 commont 的解决办法只需要3步:
解决power designer 不能自动生成注释的解决办法只需要3步: 一.快捷键 Ctrl+Shift+X 打开脚本编辑器:(快捷键不能执行的话可以从这个路径执行:Tools --> Exc ...
- Eclipse中设置在创建新类时自动生成注释
方法一:Eclipse中设置在创建新类时自动生成注释 windows-->preference Java-->Code Style-->Code Templates code--&g ...
- myeclipse自动生成注释
myeclipse自动生成注释 在使用Eclipse编写Java代码时,自动生成的注释信息都是按照预先设置好的格式生成的,例如其中author的属性值. 我们可以在Eclipse中进行设置自己希望显示 ...
随机推荐
- AC日记——密码翻译 openjudge 1.7 09
09:密码翻译 总时间限制: 1000ms 内存限制: 65536kB 描述 在情报传递过程中,为了防止情报被截获,往往需要对情报用一定的方式加密,简单的加密算法虽然不足以完全避免情报被破译,但仍 ...
- 移植SDL运行库到Tiny6410 上
在移植游戏之前, 我们首先需要将 SDL/SDL_mixer/SDL_ttf/SDL_image 这四个库移植到 Tiny6410 上, 另外还需要 iconv 库. libiconv-1.13.1. ...
- 技术专题—Python黑客【优质内容聚合贴】
作者:坏蛋链接:https://zhuanlan.zhihu.com/p/24645819来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 一.前言 本着知识分享,聚合优 ...
- linux下内网端口转发工具:linux版lcx [实现远程内网维护]
这个工具以前使用的初衷是内网渗透,需要将内网ssh端口转发到外网服务器上.但这个工具同样适用于运维工程师进行远程内网维护. 当然这一切的前提是内网可以访问外网,检测方法当然就是直接ping 一个外网I ...
- iOS中的存储方式
1.Plist 1.1 了解沙盒 每个iOS应用都有自己的应用沙盒(应用沙盒就是文件系统目录),与其它文件系统隔离.应用必须呆在自己的沙盒里.其它应用不能访问该沙盒. 一个程序中所有的非代码文件都可以 ...
- 转 mvc项目中,解决引用jquery文件后智能提示失效的办法
mvc项目中,解决用Url.Content方法引用jquery文件后智能提示失效的办法 这个标题不知道要怎么写才好, 但是希望文章的内容对大家有帮助. 场景如下: 我们在用开发开发程序的时候,经常 ...
- 树莓派及其他硬件平台国内外Linux镜像站全汇总
转载至segmentfault. 本文收集整理国内对于Raspberry Pi.CubieBoard.pcDuino等各种Linux开源硬件平台,所使用的Raspbian.Arch Linux ARM ...
- js点击左右滚动+默认自动滚动类
js点击左右滚动+默认自动滚动类 点击下载
- php的一些小细节
1.今天看见 $arr3 = array_filter($arr, create_function('$v', 'return strlen($v);')); 作用就是去掉为空的元素,其实当callb ...
- Frequently Asked Questions - P-thresholds
Source: http://mindhive.mit.edu/book/export/html 1. What is the multiple-comparison problem? What is ...