1.清除本地数据
ls_sql1 = "TRUNCATE TABLE" + ls_table [1]
execute IMMEDIATE :ls_sql1 using sqlca;
2.//打开可以插入自增,显示插入自增字段的值
ls_sql1 = "SET IDENTITY_INSERT " + ls_table [1] + " on"
execute IMMEDIATE :ls_sql1 using sqlca;
3.构造数据窗口,或datastore
4.wf_set_iden_off_1(dw_1) //关掉本地datastore的自增
wf_set_iden_off_1内容:
//将指定datastore 的自增字段设置为 off
string ls_colcount
long ll_colcount, i
string ls_ColName
ls_colcount = ar_ds.Describe("DataWindow.Column.Count")
if integer (ls_colcount) > 0 then
ll_colcount = integer (ls_colcount)
else
return
end if
string ls_on, ls_err
for i = 1 to ll_colcount
ls_ColName = ar_ds.Describe("#" + string(i) +".name")
ls_on = ar_ds.Describe("#" + string(i) +".Identity")
if ls_on = 'yes' then
ar_ds.modify (ls_ColName + ".Identity = 'no'" )
end if
next
5.开始copy,
6.update
结束
博客介绍了SQL相关操作,包括清除本地表数据,使用TRUNCATE TABLE语句;打开表的自增插入并显示自增字段值;构造数据窗口或datastore;将本地datastore的自增字段设置为off;最后进行数据copy和update操作。

443

被折叠的 条评论
为什么被折叠?



