在Powerdesigner中,根据已有字段的Name值替换Code相同的Name的值
2008-09-04 14:14
369 查看
如果在powerdesigner中有一个表我已经把名子和你码对应好了.
比如Name是年,Code是year,那么怎么把别的表中的Code是Year的Name设成年呢?
用以下代码即可,哈哈.调好了.
Dim nb
nb=ActiveSelection.Count
if nb=0 then
Output "No selected Objects"
end if
dim obj
Dim d '创建一个变量 and (not d.Exists(col.Code))
Set d = CreateObject("Scripting.Dictionary")
for Each obj in ActiveSelection
for each col in obj.Columns
if (col.Code<>col.Name) and (not d.Exists(col.Code))then
Output "--"+obj.Name+"."+obj.Code+"="+col.Name+"."+col.Code
d.Add col.Code,col.Name
end if
next
next
for Each obj in ActiveSelection
for each col in obj.Columns
if (col.Code=col.Name) and (d.Exists(col.Code) )then
Output col.Name+"."+col.Code+"."+d.Item(col.Code)
col.Name=d.Item(col.Code)
end if
next
next
比如Name是年,Code是year,那么怎么把别的表中的Code是Year的Name设成年呢?
用以下代码即可,哈哈.调好了.
Dim nb
nb=ActiveSelection.Count
if nb=0 then
Output "No selected Objects"
end if
dim obj
Dim d '创建一个变量 and (not d.Exists(col.Code))
Set d = CreateObject("Scripting.Dictionary")
for Each obj in ActiveSelection
for each col in obj.Columns
if (col.Code<>col.Name) and (not d.Exists(col.Code))then
Output "--"+obj.Name+"."+obj.Code+"="+col.Name+"."+col.Code
d.Add col.Code,col.Name
end if
next
next
for Each obj in ActiveSelection
for each col in obj.Columns
if (col.Code=col.Name) and (d.Exists(col.Code) )then
Output col.Name+"."+col.Code+"."+d.Item(col.Code)
col.Name=d.Item(col.Code)
end if
next
next
相关文章推荐
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- PowerDesigner创建表时如何根据输入的Name根据首字母自动生成Code的方法
- 解决Powerdesigner中Name和Code字段自动映射同步更新问题
- powerdesigner取消字段中name和code自动关联
- 相同name,取最小的id的值,mysql根据相同字段 更新其它字段
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- 相同name,取最小的id的值,mysql根据相同字段 更新其它字段
- PowerDesigner之设置(3)——根据Name首字母生成Code
- PowerDesigner在构建表字段时,如何实现在修改Name字段时Code字段不自动跟着变
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法
- 从PowerDesigner表字段的Name到EF实体类属性的Display Name(根据PowerDesigner生成EF实体类中文注释和验证元数据)
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变
- mysql中根据一个字段相同记录写递增序号,如序号结果,如何实现?