あなたはAll valid
としてMixed CASe
としてCharacter case
、およびValid characters
を設定し、Tools > Model Options > Naming Convention > Table > Code
下の命名規則を変更することができます。そうすれば、将来のすべてのオブジェクトはName
と一致するCode
になります。
しかし、私はそれが使用されているどこにでも引用符を付けることを避けるために、わずかに制約されたSQL名を持つ方が簡単です。 SQLの名前を更新する「Dead-man pusher」と「責任ある従業員」と「責任ある従業員」と「責任ある従業員」の間のジャンプを避けます。私は "RespEmpl"(すべてのSQL名が4文字または8文字でなければならない)とし、Name
で疲れを覚えるまで手をつないでください。
option explicit
' avoid endless loop in case of some mistake, adjust to model objects number
' set to -1 to disable
const maxcount = 1000
dim count : count = 0
dim f : set f = ActiveModel
descent f
sub descent(f)
if maxcount > 0 and count > maxcount then exit sub
output "... entering " & f.Name
dim c
for each c in f.Children
count = count + 1
if maxcount > 0 and count > maxcount then exit for
if c.ClassKind = cls_Table then
rename c
elseif isKindOf(c.ClassKind, cls_BaseFolder) then
descent c
end if
next
end sub
sub rename(o)
dim n : n = o.Code
o.setNameToCode
if o.Code <> n then output " " & o.ClassName & " " & o.Name & ", " & n & " => " & o.Code
end sub
:
OK ...私はModel Options
を変更した後、既存のオブジェクトに再び名前からコード変換を適用する方法を見つけることができないので、ここでそれを行うスクリプトです