Highlighted
Absent Member.
Absent Member.
734 views

[archive] Acu4GL for SQL Server enhancement

[Migrated content. Thread originally posted on 28 July 2005]

With Acu4GL for SQL Server when doing a start greater than statement it creates SQL similar to the following :-

select KOP_CRNO, A4GLIdentity
from db.dbo.KOP
where ((KOP_SERVICE_CODE > "BCC ") or (KOP_SERVICE_CODE = "BCC " and KOP_CRNO >= 1001))
order by KOP_SERVICE_CODE asc, KOP_CRNO

which is fine, but when the table has hundreds of thousands of rows of which a large number will be returned by the query it can be very slow.

In our case we use paged grids so actually only require the first 25 or so of each query so what would be nice is if there was some way to specify the top nn records to be returned so the SQL could be generated as

select top 25 KOP_CRNO, A4GLIdentity
from db.dbo.KOP
where ((KOP_SERVICE_CODE > "BCC ") or (KOP_SERVICE_CODE = "BCC " and KOP_CRNO >= 1001))
order by KOP_SERVICE_CODE asc, KOP_CRNO

Adding something like a 4GL_TOP_COUNT along similar lines to the 4GL_WHERE_CONSTRAINT may be a way to do this.
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Acu4GL for SQL Server enhancement

Try using the A_MSSQL_ROWCOUNT environment variable.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Acu4GL for SQL Server enhancement

Hmm.. I must read those Acu guides more carefully !!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.