ContentsIndexPreviousNext

A_SYB_USE_DROPDOWN_QUERIES

Setting A_SYB_USE_DROPDOWN_QUERIES to a non-zero value causes select queries 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 three fields in the primary key (keyseg1, keyseg2, keyseg3), and your COBOL program does a START, 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, the following collection of queries is 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, the interface sends:

select (columns) from (table) where (keyseg1
= value1 and keyseg2 > value2) order by
keyseg1, keyseg2, keyseg3


And when that set is finished, the interface sends:

select (columns) from (table) where (keyseg1
> value1) order by keyseg1, keyseg2, keyseg3

There are advantages and disadvantages 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 limits the result set sufficiently that the larger query will be more efficient.

If you usually START files, and read to the end, 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" (off, false, no), this configuration variable can also take the value of "On" (true, yes).

Example

     A_SYB_USE_DROPDOWN_QUERIES number

where number is a zero or non-zero value.