insert #(col....)--用臨時表記錄
execute pos_pr_get_item_info @as_branchNo ='01' , @as_ItemNO =@item_no ,@an_saleQty =- 1000000
execute pos_pr_get_item_info @as_branchNo ='01' , @as_ItemNO =@item_no ,@an_saleQty =- 1000000
如果想要修改的话,
第一,查看你的游标本身又没有逻辑问题。
第二,声明一个临时表,然后execute pos_pr_get_item_info @as_branchNo ='01' , @as_ItemNO =@item_no ,@an_saleQty =- 1000000 在这句话之前,加上insert into #temptable
execute pos_pr_get_item_info @as_branchNo ='01' , @as_ItemNO =@item_no ,@an_saleQty =- 1000000 在销毁游标之后,加上一句select * from #temptable就可以以一个数据集的形式返回了
-->>定义的临时表和你的查询的数据类型不符?例如数据的字符串长度超出了定义的临时表的字符最大长度。
有这个可能吗?检查下数据吧。-->>另外考虑下你的pos_pr_get_item_info存储过程中间会不会出问题呢?
果真是长度超了.......
不过结果是空啊
一条纪录也没写进去CREATE PROCEDURE auto
AS
BEGIN TRANSACTION tran_test
SAVE TRANSACTION tran_test
declare @item_no int,
@Prodcount int
delete ticheng
declare Aotu_cursor cursor for
select item_no from bi_t_item_info where flag2 in ('Z','J') and item_clsno like '21%' order by item_subno
open Aotu_cursor
fetch next from Aotu_cursor into @item_no
WHILE @@FETCH_STATUS = 0begin
insert into ticheng execute pos_pr_get_item_info @as_branchNo ='01' , @as_ItemNO =@item_no ,@an_saleQty =- 1000000
fetch next from Aotu_cursor into @item_no
endROLLBACK TRANSACTION tran_test
COMMIT TRANSACTION tran_test
close Aotu_cursor--关闭
DEALLOCATE Aotu_cursor--释放
select * from ticheng