Release 10.1A: OpenEdge Development:
Progress 4GL Reference

> ## INDEX-INFORMATION attribute

> A character string consisting of a comma-separated list of the index or indexes the query uses at the level of join specified.

> Data type: CHARACTER

> Access: Readable

> Applies to: Query object handle

> Syntax
>     INDEX-INFORMATION ( n )

> ``n``

> An INTEGER expression that evaluates to the level of join for which you want index information.

> If the index or indexes do not have bracketing, the first entry in the list is the CHARACTER string “WHOLE-INDEX,” and the second entry in the list is name of the index.

> Before you use INDEX-INFORMATION on a dynamic query, you must prepare the query using the QUERY-PREPARE method.

> Before you can use the INDEX-INFORMATION attribute on a static query, you must define the query using the DEFINE QUERY statement’s RCODE-INFORMATION option.

> The following example prints out the PREPARE-STRING, analyzes the INDEX-INFORMATION, and prints a list of bracketed and whole-index indexes:

> r-iinfo.p
>     /* r-iinfo.p */

>     def query q for customer,order,order-line scrolling.
>     def var x as handle.
>     def var i as integer.
>     def var j as integer.

>     x = query q:handle.

>     x:query-prepare("for each customer where cust-num < 3,
>       each order of customer, each order-line").
>     x:query-open.

>     message "prepare string is" x:prepare-string.

>     repeat i = 1 to x:num-buffers:
>       j = lookup("WHOLE-INDEX",x:index-information(i)).
>       if (j > 0)
>         then message "inefficient index"
>                      entry(j + 1,x:index-information(i)).
>         else message "bracketed index use of" x:index-information(i).
>     end.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095