PowerDesigner sync name to Comment and sync Comment to name

Source: Internet
Author: User

  

The methods used in PowerDesigner are:

Powerdesigner->tools->execute Commands->edit/run Scripts

Code one: copy the characters in name to comment

Option Explicit Validationmode=True Interactivemode=Im_batchdim MDL'The current model'get the current active modelSet 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 isn't an physical Data model."Else processfolder mdl End If'This routine copy name to comment for each table, each column and each view'Of the current folderPrivate Sub ProcessFolder (folder) Dim Tab'Running Table       forEach TabinchFolder.tablesifNot Tab.isshortcut then tab.comment=tab.name Dim Col'Running Column                   forEach colinchtab.columns col.comment=col.name Next EndifNext Dim View'Running View       forEach viewinchfolder. viewsifNot View.isshortcut then view.comment=View.name EndifNext'go into the sub-packagesDim F'Running FolderFor each f in folder. PackagesifNot F.isshortcut then ProcessFolder F endifNext End Sub

Code two: copy the characters from the comment to the name

Option Explicit Validationmode=True Interactivemode=Im_batchdim MDL'The current model'get the current active modelSet 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 isn't an physical Data model."Else processfolder MDL End ifprivate Sub ProcessFolder (folder) on Error Resume Next Dim Tab 
    'Running Table       forEach TabinchFolder.tablesifNot Tab.isshortcut then Tab.name=tab.comment Dim Col'Running Column                   forEach colinchTab.columnsifCol.comment="" ThenElseCol.name=Col.comment EndifNext EndifNext Dim View'Running View       forEach viewinchfolder. viewsifNot View.isshortcut then View.name=View.comment EndifNext'go into the sub-packagesDim F'Running FolderFor each f in folder. PackagesifNot F.isshortcut then ProcessFolder F endifNext End Sub

PowerDesigner sync name to Comment and sync Comment to name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.