怎样才能将数据库中表PBCATCOL的PBC_LABL字段的值反向到PDM对应的NAME?

1 篇文章 0 订阅
PowerDesigner可以将PDM的NAME值写入数据库的PBCATCOL表中相应的几个字段,但我现在通过PD的Resever Engineer功能将数据库的表反向到PDM中,怎样才能使当时生成在表PBCATCOL中的相应NAME值同时反向到PDM的NAME(我想要是的中文)。
先谢了!
回复人:不愿放弃(byfq) 2004-12-2 12:36:37
PowerDesigner数据库系统分析设计与应用 姜江著 一书中写有,有点复杂,记不清楚了,你可以找找看看
回复人:阿飞(nbnasom) 2004-12-3 14:37:37
学习ING
回复人:【最后一滴水】(am2000) 2004-12-4 22:33:52
Tools-PowerBuilder-Reverse Extended Attributes
回复人:【最后一滴水】(am2000) 2004-12-4 23:33:48
我也碰到这个问题。
我现已通过逆向工程将数据库中的LABEL、HEADER、COMMENT逆向到PDM的Extended attributes中了。
但我不知道如何将Label赋值到NAME.
回复人:【最后一滴水】(am2000) 2004-12-4 23:45:44
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 code for each table, each column and each view
' of the current folder
Private sub ProcessFolder(folder)
dim ls_NameTemp
Dim Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
'tab.code = tab.name

if instr(Tab.name," ") > 0 then
ls_NameTemp = Mid(Tab.name,1,instr(Tab.name," ") - 1 )
else
if instr(Tab.name," ") > 0 then
ls_NameTemp = Mid(Tab.name,1,instr(Tab.name," ") - 1 )
else
ls_NameTemp = Tab.name
end if
end if


if len(ls_NameTemp) < 8 then
Tab.name = ls_NameTemp + Space( 8 - len(ls_NameTemp) ) + Tab.code
else
Tab.name = ls_NameTemp + Space( 2 ) + Tab.code
'考虑名称相同出现的异常
end if
On Error Resume Next


Dim col ' running column
for each col in tab.columns
'col.code= col.name
if instr(col.name," ") > 0 then
ls_NameTemp = Mid(col.name,1,instr(col.name," ") - 1 )
else
if instr(col.name," ") > 0 then
ls_NameTemp = Mid(col.name,1,instr(col.name," ") - 1 )
else
ls_NameTemp = col.name
end if
end if

if len(ls_NameTemp) < 6 then
'col.name = ls_NameTemp + Space( (8 - len(ls_NameTemp)) * 2 ) + col.code
col.name = ls_NameTemp + left( "          ",6 - len(ls_NameTemp) ) + col.code
else
'col.name = ls_NameTemp + Space(2) + col.code
col.name = ls_NameTemp + left( "          ",1) + col.code

'考虑名称相同出现的异常
end if
On Error Resume Next

next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
'view.code = view.name

if instr(view.name," ") > 0 then
ls_NameTemp = Mid(view.name,1,instr(view.name," ") - 1 )
else
if instr(view.name," ") > 0 then
ls_NameTemp = Mid(view.name,1,instr(view.name," ") - 1 )
else
ls_NameTemp = view.name
end if
end if

if len(ls_NameTemp) < 8 then
view.name = ls_NameTemp + Space( 8 - len(ls_NameTemp) ) + view.code
else
view.name = ls_NameTemp + Space( 2 ) + view.code
'考虑名称相同出现的异常
end if
On Error Resume Next


end if
next
' 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值