pdm 里面的物理表 在倒sql 出来的时候(db2数据库),我想添加列注释,根据网上的方法,不管我怎么设置,列属性就是加不上。
我的具体方法如下:数据库---》EDIT CURRENT DBMS ...然后图片如下。。。
倒出来的sql 为:
DROP TABLE CCR_AREA_RISK;
--==============================================================
-- Table: CCR_AREA_RISK
--==============================================================
CREATE TABLE CCR_AREA_RISK
(
AREA_CODE VARCHAR(20) NOT NULL,
RISK_FACTOR NUMERIC(16,2),
CONSTRAINT "P_KEY_1" PRIMARY KEY (AREA_CODE)
);
反正就是没有注释,不管我怎么改,也不报错,也不出来。。。。是不是要在哪里设置一下开关??
找到了,将Name中的字符COPY至表的Comment中
步骤:
将下面的脚本拷贝
PowerDesigner->Tools->Execute Commands->Edit/Run Scripts,然后RUN,再导出就有注释了。
[code="SCRIPT"]
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
[/code]
貌似可以写脚本,好像是VB的~
以前用过,我找找看
参考下这个把
http://blog.csdn.net/wzhibin/archive/2010/03/17/5389372.aspx
具体的脚本晚上找找看~ 方法肯定是有的
对的,那种方式也可以的,我以前用的是我这种方式~
一定要赞一个 好使的