美文网首页
powerdesigner comment与name互转

powerdesigner comment与name互转

作者: 指针v587 | 来源:发表于2019-01-10 15:41 被阅读0次

    tools --> Excute Commands --> Edit/Run Script

    
    comment转name:
    
    OptionExplicit
    
    ValidationMode =True
    
    InteractiveMode = im_Batch
    
    Dimmdl'the current model
    
    'get the current active model
    
    Setmdl = ActiveModel
    
    If(mdlIsNothing)Then
    
    MsgBox"There is no current Model"
    
    ElseIfNotmdl.IsKindOf(PdPDM.cls_Model)Then
    
    MsgBox"The current model is not an Physical Data model."
    
    Else
    
    ProcessFolder mdl
    
    EndIf
    
    'This routine copy name into code for each table, each column and each view
    
    'of the current folder
    
    PrivatesubProcessFolder(folder)
    
    DimTab'running table
    
    foreachTabinfolder.tables
    
    ifnottab.isShortcutthen
    
    iflen(tab.comment) <>0then
    
    tab.name = tab.comment
    
    endif
    
    OnErrorResumeNext
    
    Dimcol'running column
    
    foreachcolintab.columns
    
    iflen(col.comment) <>0then
    
    col.name =col.comment
    
    endif
    
    OnErrorResumeNext
    
    next
    
    endif
    
    next
    
    endsub
    
    

    name转comment:

    
    OptionExplicit
    
    ValidationMode =True
    
    InteractiveMode = im_Batch
    
    Dimmdl'the current model
    
    'get the current active model
    
    Setmdl = ActiveModel
    
    If(mdlIsNothing)Then
    
    MsgBox"There is no current Model"
    
    ElseIfNotmdl.IsKindOf(PdPDM.cls_Model)Then
    
    MsgBox"The current model is not an Physical Data model."
    
    Else
    
    ProcessFolder mdl
    
    EndIf
    
    'This routine copy name into code for each table, each column and each view
    
    'of the current folder
    
    PrivatesubProcessFolder(folder)
    
    DimTab'running table
    
    foreachTabinfolder.tables
    
    ifnottab.isShortcutthen
    
    tab.comment = tab.name
    
    Dimcol'running column
    
    foreachcolintab.columns
    
    col.comment= col.name
    
    next
    
    endif
    
    next
    
    Dimview'running view
    
    foreachviewinfolder.Views
    
    ifnotview.isShortcutthen
    
    view.comment = view.name
    
    endif
    
    next
    
    'go into the sub-packages
    
    Dimf'running folder
    
    ForEachfInfolder.Packages
    
    ifnotf.IsShortcutthen
    
    ProcessFolder f
    
    endif
    
    Next
    
    endsub
    
    

    相关文章

      网友评论

          本文标题:powerdesigner comment与name互转

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