'******************************************************************************
'* 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
清明节习俗优秀作文450字01-01
乔迁之喜邀请函范文01-01
四字补充短语举例100个01-01
工作记录本填写说明01-01
古诗板印书籍,唐人尚未盛为之翻译赏析01-01
计算的拼音01-01
钉组词_钉的组词有哪些01-01