PDM生成sql語句時沒有注釋

2021-10-05 20:25:52 字數 1461 閱讀 6161

在使用powerdesigner資料庫建模時,pdm生成sql語句時沒有注釋,提供萬能解決方式:

1. 開啟powerdesigner 通過選單中找 ( tools --> excute commands --> edit/run script...),如下圖所示:

2. 複製下面的腳步:

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

'把列名稱和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

SQL語句注釋的妙用

mysql裡面的sql語句,裡面是可以加注釋的 例如 select from author where authorid 1 可以寫成 get a author select from author where authorid 1 照樣可以正常執行。有人說,這有鳥用啊?那好看下面 1 在php裡面...

sql語句生成sql指令碼

sql語句有一種特別的用法,相信很多人還不知道,我也是後來學到的,因此拿來跟大家分享下 生成sql指令碼 舉個例子 select 1 from student 如果表中有資料的話,你就會發現查詢的結果會是 根據這個原理,我們可以用來生成sql指令碼,以下就是例項 例項1 乙個簡單的例子 select...

動態生成SQL語句

procedure tform1.excutebtnclick sender tobject begin sqlquery1.sql.clear sqlquery1.sql.add select item.text from table.text item.text為輸入查詢專案編輯框,table....