


Setting A-SYB-USE-DROPDOWN-QUERIES to a non-zero value causes selects sent to the database to be of the drop-down variety, instead of a single large query. This variable is accessed only during a positioning operation, so you can set it at different times for different tables. For example, if you have a file with 3 fields in the primary key, (keyseg1, keyseg2, keyseg3), and your COBOL program does a START, then the following query is sent to the database:
select (columns) from (table) where ((keyseg1 = value1 and keyseg2 = value2 and keyseg3 > value3) or (keyseg1 = value1 and keyseg2 > value2) or (keyseg1 > value1)) order by keyseg1, keyseg2, keyseg3
If you use drop-down queries, then the following collection of queries will be sent instead:
select (columns) from (table) where (keyseg1 = value1 and keyseg2 = value2 and keyseg3 > value3) order by keyseg1, keyseg2, keyseg3
When that set is finished, we then send:
select (columns) from (table) where (keyseg1
= value1 and keyseg2 > value2) order by
keyseg1, keyseg2, keyseg3
And when that set is finished, we then send:
select (columns) from (table) where (keyseg1
> value1) order by keyseg1, keyseg2, keyseg3
There are advantages and disadvantage to each method. If you use the A4GL-WHERE-CONSTRAINT variable, you should probably set A-SYB-USE-DROPDOWN-QUERIES to 0, since the where-constraint will limit the result set sufficiently that the larger query will be more efficient.
If you usually START files, and read to the end, then you should set A-SYB-USE-DROPDOWN-QUERIES to 0, since a fewer number of queries need to be sent to the database. On the other hand, if you START files, and stop reading after some condition, but haven't used the where-constraint, then you may get more efficient access by setting this variable to 1, and using the drop-down style of query. In either case, it is recommended that you run some tests to see which value of this variable makes the most sense for your application. While the default value is "0", this configuration variable can also take values of "Yes," "No," "True," "False," "On," or "Off."
Example
A-SYB-USE-DROPDOWN-QUERIES zero or a non-zero number.