powerDesigner用字段name替换comment,用于

2021-04-20  本文已影响0人  小明_d19e

前提是我数据库用pd生成的,若依自动生成vue代码时需要comment,但是数据库生成的时候没写.现在我找到了一个批量生成的方法:工具->execute commands->run 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

Private   sub   ProcessFolder(folder) 
On Error Resume Next
  Dim   Tab   'running table 
  for   each   Tab   in   folder.tables 
if   not   tab.isShortcut   then 
  tab.name   =   tab.comment
  Dim   col   '   running   column 
  for   each   col   in   tab.columns 
  if col.comment="" then
  
    col.comment = col.name
  end if
  next 
end   if 
  next



end   sub
上一篇 下一篇

猜你喜欢

热点阅读