美文网首页
powerDesigner用字段name替换comment,用于

powerDesigner用字段name替换comment,用于

作者: 小明_d19e | 来源:发表于2021-04-20 16:25 被阅读0次

前提是我数据库用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

相关文章

网友评论

      本文标题:powerDesigner用字段name替换comment,用于

      本文链接:https://www.haomeiwen.com/subject/pdpnlltx.html