急!急!急!PB+SQLSERVER无法成功执行存储过程
各位高手:
表:create table aaa (
aa numeric(5) primary key,
bb varchar(10))
存储过程:create procedure sp_insert
@aa numeric(5),
@bb varchar(10),
@cc varchar(5) output
as
begin tran
insert into aaa values (@aa,@bb)
if @@error<>0
begin
rollback tran
select @cc = -100
end
else
begin
commit tran
select @cc = 0
end
end if
问题如下:
1 在PB中第一次执行有如下提示:
A: Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement
is missing. Previous count = 1, current count = 0.
第二次执行有如下提示:
B:The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
去了存储过程的begin tran 和 rollback tran和commit tran正常,为什么???
难道只能在PB中提交???
2 无法在PB中获取存储过程的return值
如存储过程中的return -100和return 0PB无法取得
用FETCH有如下提示:
Cursor is not open
急盼高手解答,thank!!!