本帖最后由 sbeg571 于 2015-9-6 13:43 编辑
sybase12.5数据库,连接后使用带参数的存储过程,在SQL下exec执行没问题,但在finereport7.1中使用存储过程,增加参数保存后日志报错如下:
警告:The identifier that starts with '" select sybid=identity(12), ' is too long. Maximum length is 28.
莫非存储过程中有长度限制????存储过程如下:
create procedure splitpage222
@qry varchar(16384),
@ipage int,
@num int,
@maxpages int = 5000
as
begin
declare @rcount int
declare @execsql varchar(16384)
if @ipage > @maxpages
begin
select '输入页数大于最大查询页数'
return
end
select @rcount=@ipage*@num
set rowcount @rcount
set @execsql = stuff(@qry,charindex('select',@qry),6,'select sybid=identity(12),')
set @execsql = stuff(@execsql, charindex('from',@execsql),4,'into #temptable1 from')
set @execsql = @execsql || ' select * from #temptable1 where sybid>' || convert(varchar,(@ipage-1)*@num) || ' and sybid <= ' || convert(varchar,@ipage*@num)
execute (@execsql)
set rowcount 0
end
;
调用如下:
exec splitpage222
“ select * from a ”,
1,
5