Bulk powerdesigner table fields from lowercase to uppercase

Source: Internet
Author: User
Tags lowercase powerdesigner
Http://paskaa.iteye.com/blog/1583050\ because the table when the wood has attention, 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, in Tools=>execute Edit/run Scripts under Commands, or run the following script through Ctrl+shift+x:

'*****************************************************************************
' 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: recursively traverse all sequences
  ' *********************************************************
 sub processsequences (folder)
  ' Process a sequence in a model: lowercase to uppercase
 dim sequence
 for 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

' *****************************************************************************
  ' functions: ProcessTable
  Function: Iterates through all fields of the specified table, changing the field name from lowercase to uppercase,
  ' field code from lowercase to uppercase
  ' table name changed from lowercase to uppercase  
' ****************
 sub processtable (table)
 dim col
 for each col in table. Columns
  ' change 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

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.