'******************************************************************************
'* File: 检查名称长度.vbs
'* 目的: 检查表名、主键名、Ref、Index名称的长度是否小于30
'* 创建日期: 2014.05.15
'* 创建人: lixinglei
'* 执行方式:Ctrl+shift+x
'******************************************************************************
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
' This routine copy name into comment for each table, each column and each view
' of the current folder
Private sub ProcessFolder(folder)
Dim Tab 'running table
for each Tab in folder.tables
if len(Tab.code) > 30 then
output "Scans table: " + Tab.code + " 长度:" + Cstr(len(Tab.code))
end if
next
output " table 检查完成! "
output
'Dim Tab 'running table
for each Tab in folder.tables
if len(Tab.PrimaryKey.code) > 30 then
output "Scans Primary Key: " + Tab.PrimaryKey.code + " 长度:" + Cstr(len(Tab.PrimaryKey.code))
end if
next
output " Primary Key 检查完成! "
output
Dim ref 'running ref
for each ref in folder.References
if len(ref.code) > 30 then
output "Scans Reference: " + CStr(ref.code) + " 长度:" + Cstr(len(ref.code))
end if
' output Cstr(ref.code) +Cstr(len(ref.code))
next
output " Reference 检查完成! "
output
'Dim Tab 'running Index
for each Tab in folder.tables
Dim idx
for each idx in tab.Indexes
if len(idx.code) > 30 then
output "Scans Index: " + idx.code + " 长度:" + Cstr(len(idx.code))
end if
next
next
output " Index 检查完成! "
output
' go into the sub-packages
Dim f ' running folder
For Each f In folder.Packages
if not f.IsShortcut then
ProcessFolder f
end if
Next
end sub
本文来源:https://www.wddqw.com/doc/2cdcbf456edb6f1afe001f40.html
正在阅读:
powerdesigner 检查名称长度01-01
关于送别朋友的作文五篇01-01
企业情况简介范文01-01
审计的报告格式范文01-01
管窥蠡测的近义词是什么01-01
勇敢的人可用生命冒险,但不以良心冒险01-01
萧疏的意思01-01
用方格稿纸写的预防溺水的作文300字题目01-01
精选学校宣传报道稿01-01