crackajackk 2010-10-21 10:24
浏览 552
已采纳

PDM生成sql脚本添加注释的问题

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)
);

反正就是没有注释,不管我怎么改,也不报错,也不出来。。。。是不是要在哪里设置一下开关??

  • 写回答

5条回答 默认 最新

  • iteye_4873 2010-10-21 21:40
    关注

    找到了,将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]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?