Highlighted
Absent Member.
Absent Member.
1046 views

[archive] Acu4GL and the WHERE constraint

[Migrated content. Thread originally posted on 23 May 2004]

We use the WHERE constraint in our application to provide upper boundaries when doing a start in the file operations. This works fine when we know the scope of the records that need to be processed. (e.g. when we need to find all records that have an ID of 555555555, we can supply an upper boundary of greater than the ID, and it treats any record greater as an invalid key)
But when we don't know the scope of the data to be processed, we haven't found a way to use the WHERE constraint. For example, give me the first 50 records in a file for a listbox. We can't figure out a way to use a WHERE constraint to provide an upper boundary.
Has anyone else encountered this problem using Acu4GL, and found a trick to use to provide a constraint to minimize the file i/o? Some of these files have 50-500K records, so narrowing the scope is very important to us.
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Acu4GL and the WHERE constraint

If your connecting to an RDBMS like sql server then you have a few options.

You can use a stored procedure that copies the desired records to a seperate table. This table can then be opened by your acucobol program, provoided you have created a file select, description and xfd for it. Stored procedures can be extremely fast because they run server side.

If your RDBMS supports Views then you can use them as a kind of proxy for your tables. Views behave just like normal tables but they pull data dynamically from other tables because they are able to use queries to retrieve data.

You will find stored procedures and views can be very powerful and can improve your RDBMS data processing in significant ways.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Acu4GL and the WHERE constraint

Also see the A-MSSQL-ROWCOUNT configuration option.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Acu4GL and the WHERE constraint

I can see where the A-MSSQL-ROWCOUNT variable can be very useful in limiting the operations necessary. Unfortunately, not in this case, because the data we are looking at are Names, and has duplicate keys. But I know of other places where I can make use of this. Thanks!
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.