powdesigner 物理模型生成SQL脚本的一些问题
1、由pdm生成建表脚本时,字段超过15字符就发生错误(oracle)原因未知。
2、生成的建表脚本中如何把对象的双引号去掉。
3、建立一个表后,检测出现Existence of index的警告 A table should contain at least one column, one index, one key, and one reference.
4、name与code同步问题
5。对于大小写不敏感的数据库(如Oracle),PowerDesign在创建脚本时自动给表名和字段名加上双引号,以“强字符串”形式来获取区分大小写,这样给sql语句的编写制造很多麻烦。必须去掉这个多余的功能。
6.生成SQL时报错:Generation aborted due to errors detected during the verification of the model。
7.导出数据库时报错:Error The following objects do not have unique constraint。
8.物理模型导出数据库时保存name作为code的注释行.
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 Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
tab.comment = tab.name + tab.comment '此处任意设置表的注释,此处为表名和注释一起
Dim col ' running column
for each col in tab.columns
col.comment= col.name + col.comment
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.comment = view.name
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
运行,然后Database --> Generate Database ,在formata选中Generate name in empty comment这时就可以生成带有comments为物理模型中Name属性的SQL语句了。
9.导出SQL脚本运行注释出现乱码问题:
10.导出SQL脚本运行建表时注释行出现重复现象(未解决)。
11.10.导出SQL脚本运行建表时缺少几个表。