Bulk powerdesigner table fields from lowercase to uppercase

Source: Internet
Author: User
Tags powerdesigner

Due to the time the table was built, in the production of SQL PD in the column name is added "" This thing, so only through the following VB script can be modified in bulk, Edit/run Scripts under Tools=>execute commands, or by CTRL + Shift+x Run the following script:

‘*****************************************************************************
' File: Powerdesigner.ucase.VBs
' Version: 1.0
' Function: Traverse all the tables in the physical model, changing the table name, table code, field name, field code all from lowercase to uppercase;
' and change the name and code of the sequence from lowercase to uppercase.
' Usage: Open the physical model, run this script (ctrl+shift+x)
Notes
‘*****************************************************************************
Dim model ' Current model
Set model = Activemodel

If (model is nothing) then
MsgBox "There is no current Model"
ElseIf not model. IsKindOf (Pdpdm.cls_model) Then
MsgBox "The current model isn't an physical Data model."
Else
Processtables model
Processsequences model
End If

‘*****************************************************************************
' Function: processsequences
' Function: Recursive traversal of all sequences
‘*****************************************************************************
Sub Processsequences (folder)
' Process the sequence in the model: lowercase to uppercase
Dim sequence
For each sequence in folder.sequences
Sequence.name = UCase (sequence.name)
Sequence.code = UCase (Sequence.code)
Next
End Sub

' *****************************************************************************
  ' functions: ProcessTables
  Functions: recursively traverse all tables
  ' *****************************************************************************
 sub processtables (folder)
  ' working with tables in the Model
 dim table
 for each table in Folder.tables
 if not table. Isshortcut then 
processtable table
 end if
 next
  ' subdirectories recursively
 dim Subfolder
 for each subfolder in folder. Packages
 processtables subfolder
 next 
End Sub

‘*****************************************************************************
' Function: processtable
' function: Iterates through all fields of the specified table, changing the field name from lowercase to uppercase.
' field code is changed from lowercase to uppercase
' The table name is changed from lowercase to uppercase
‘*****************************************************************************
Sub Processtable (table)
Dim col
For each of the Col in table. Columns
' Change the field name from lowercase to uppercase
Col.code = UCase (Col.code)
Col.name = UCase (col.name)
Next
Table.name = UCase (table.name)
Table.code = UCase (Table.code)
End Sub

Bulk powerdesigner table fields from lowercase to uppercase

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.