SAP Knowledge Base Article - Preview

2408819 - SELECT with functions and Pagination give wrong results - SAP ASE

Symptom

A SELECT statement using functions and the Pagination Queries Using limit and offset feature, introduced on SAP ASE 16.0 SP02 PL05, produces wrong result sets.  For example:

create table testPag
(
id int not null,
name1 varchar(250) null,
name2 varchar(250) null
)
go

INSERT INTO dbo.testPag(id, name1, name2) VALUES(5, 'eeeee', 'eeeee')
go
INSERT INTO dbo.testPag(id, name1, name2) VALUES(4, 'dddd', 'dddd')
go
INSERT INTO dbo.testPag(id, name1, name2) VALUES(3, 'ccc', 'ccc')
go
INSERT INTO dbo.testPag(id, name1, name2) VALUES(2, 'bb', 'bb')
go
INSERT INTO dbo.testPag(id, name1, name2) VALUES(1, 'a', 'a')
go
SELECT char_length(name1) FROM testPag ORDER BY char_length(name1) ROWS OFFSET 1 LIMIT 5
go

Result set:
1
2
3
4

The RESULTS Should be:

2
3
4
5


Read more...

Environment

SAP Adaptive Server Enterprise (ASE) 16.0  SP02 PL05 and above

Product

SAP Adaptive Server Enterprise 16.0

Keywords

select, functions, function, pagination, limit, offset, wrong results, wrong result , KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , Bug Filed

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.