PB调用存储过程的出错--急急急!!
sqlserver2000存储过程为:
ALTER procedure p_getmaxid(@tablename varchar(50),@preface varchar(50),@bh varchar(50) output)asbegin trandeclare @i intdeclare @curdate char(8)select @curdate=replace(convert(char(11),getdate(),121),'-','')update tablemax with(rowlock) set @i=case when currentdate=@curdate then maxid+1 else 1 end, currentdate = @curdate,@bh= preface+@curdate+right(power(10,len)+@i,len),maxid=@i where preface = @preface and tablename=@tablename commit tran
string bh,tablename,prefacetablename="bloodapp"preface="app"DECLARE pgetmaxid PROCEDURE FOR p_getmaxid @tablename=:tablename,@preface=:preface,@bh=:bh outputusing sqlca;execute pgetmaxid;if sqlca.sqlcode<>0 then close pgetmaxid; return else FETCH pgetmaxid INTO :bh; if sqlca.sqlcode<>0 then close pgetmaxid; return end ifend if