Consultor Eletrônico



Kbase 15570: An Example of How to Reposition to the End of a Joined Query
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
An Example of How to Reposition to the End of a Joined Query

INTRODUCTION
============
This knowledgebase entry gives an example of how to reposition to the
last record in a browse in which the browse query is a join of two
tables.

PROCEDURAL APPROACH
===================
Following is a code example written against sports which contains
a browse which joins order and order-lines tables. The browse
displays the order number, line number and item number for each order
line for each order in the database. There is a button on the frame
which does the following:
1) GET LAST query name - this returns the last record associated
with the query which is the last order record that has order
lines associated with it
2) REPOSITION query name TO ROWID ROWID(ORDER) - this repositions
the query to the last order line of the last order in the query
Visually, it moves the highlight to the end, or last record, of the
browse.

define query q1 for order, order-line.
define browse b1 query q1
display order.order-num order-line.line-num order-line.item-num
with 10 down.

define button go-last label "Go to Last".

define frame f1
b1 at row 3 col 15
go-last at row 13 col 30
with side-labels at col 1 row 1 centered size 80 by 16.

on choose of go-last do:
get last q1.
reposition q1 to rowid rowid(order).
end.

open query q1 for each order, each order-line of order.
enable all with frame f1.
wait-for window-close of current-window.

REFERENCES TO WRITTEN DOCUMENTATION
===================================
Progress Programming Handbook
Progress Language Reference

Progress Software Technical Support Note # 15570