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)  編輯  收藏 所屬分類: 遇到的一些問題

          主站蜘蛛池模板: 瑞金市| 扬州市| 美姑县| 威海市| 绥德县| 赫章县| 许昌市| 安新县| 西城区| 平乐县| 景泰县| 休宁县| 鄄城县| 西林县| 高陵县| 灵丘县| 嘉定区| 新丰县| 苍溪县| 洛隆县| 甘谷县| 定日县| 宣恩县| 潮州市| 贵溪市| 秀山| 宁陕县| 普宁市| 黄浦区| 宁武县| 凤山县| 涟水县| 奉节县| 凌海市| 汶川县| 磐石市| 华安县| 皋兰县| 奎屯市| 原阳县| 衡阳县|