在VFP中,如何将用SQL查询生成的CURSOR中的数据追加到一个数据库的表中?
例如select a,b,c from dbf_name1 into cursor dbf_name2
现有库表dbf_name3,字段有c,b,c,d,e,f.....
如何将dbf_name2中的内容,追加到dbf_name3中?
...全文
1832打赏收藏
数据追加
在VFP中,如何将用SQL查询生成的CURSOR中的数据追加到一个数据库的表中? 例如select a,b,c from dbf_name1 into cursor dbf_name2 现有库表dbf_name3,字段有c,b,c,d,e,f..... 如何将dbf_name2中的内容,追加到dbf_name3中?
create procedure InsertRec
as
declare
@b type,
@c type,
begin
declare CurGetData cursor
for select b, c from dbf_name1
open CurGetData
fetch CurGetData into @b,@c
while @@fetch_status = 0
begin
insert dbf_name2 (b,c)
values (@b,@c)
fetch CurGetData into @b,@c
end
close CurGetData
deallocate CurGetData
end
//SQL Server中的存储过程