找回密码
 注册
搜索
热搜: 回贴
微赢网络技术论坛 门户 数据库 查看内容

rowscopy,拷贝带有自增字段的表

2009-12-14 18:29| 发布者: admin| 查看: 32| 评论: 0|原作者: 江海

○1.清除本地数据 ls_sql1="TR......


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
结束

最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 17:31 , Processed in 0.263268 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部