StevenBot-Saltsam

          眼睛能裝下世界,為何卻裝不下眼淚? 一只風箏一輩子只為一根線冒險。 那不是一場游戲,為何總有一根線牽著心懷,隱隱作疼? 那不是一段邂逅,為何飄在橋上的影子,總纏進夢鄉? 那不是一個夢境,為何你的溫柔私語,總是不經意的響起?

          導航

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          統計

          常用鏈接

          留言簿

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          datas link

          OSChinal Sources codes Library

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          由PowerDesigner物理模型生成sql語句

          Tools-->Execute Commands-->Edit/Run Script 在打開的窗口中 past 下面的代碼:

          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 code 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  + tab.comment '此處任意設置表的注釋,此處為表名和注釋一起

                   Dim col ' running column

                   for each col in tab.columns

                      col.comment= col.name + col.comment

                   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

           

          Database --> Generate Database  這時就可以生成帶有comments為物理模型中Name屬性的SQL語句了。

          posted on 2011-10-08 10:13 Steven_bot 閱讀(1261) 評論(0)  編輯  收藏 所屬分類: 遇到的一些問題

          主站蜘蛛池模板: 进贤县| 嵊州市| 安达市| 江孜县| 铜梁县| 富顺县| 务川| 定襄县| 新乡县| 新邵县| 成都市| 林芝县| 扎囊县| 中卫市| 通渭县| 赤水市| 铜梁县| 芜湖市| 神池县| 昭觉县| 德安县| 格尔木市| 白朗县| 南安市| 贵南县| 杭州市| 道孚县| 高碑店市| 酒泉市| 临泉县| 康定县| 高邑县| 上饶县| 兴业县| 论坛| 邢台市| 固阳县| 德州市| 长垣县| 莱西市| 蚌埠市|