Multiple buffers on same table in dynamic query?

Fredmeu

New Member
Platform:
Progress Provision v9.0 !!!!
Win2000
------------------------------

Hi All,

Since i'm fairly new to Progress v9 / Webspeed programming, a short question about dynamic queries...

After performing some tests / reading the various topics about dynamic queries here, I managed to write a template - include file which based on some preprocessors automatically generates a HTML file displaying the returned records from my dynamic query....

So far I managed to make the query itself & the number of fields and/or tables used in the query fairly flexible, but now I'm stuck....

What I want to achieve is quite simple in Progress 4GL;

DEF BUFFER bemp FOR emp.
DEF BUFFER cemp FOR emp.

FOR EACH req
,FIRST emp WHERE emp.emp_nr = req.req_registered_by
,FIRST bemp WHERE bemp.emp_nr = req.req_treated_by
,FIRST cemp WHERE cemp.emp_nr = req.req_owner_nr
:
DISP req.req_nr
emp.emp_name
bemp.emp_name
cemp.emp_name.
END.

You have a "request for service" table. Each request is registered by a helpdesk employee, has a request owner (the one which reported the error) and a developer picking up the problem. All three persons are defined in the same table "emp", so multiple buffers are necessary to display the names at the same time....

Now I have built the webspeed template based on dynamic queries;

QUERY-PREPARE("{&qrycls}").

in which the qrycls preprocessor contains
"FOR EACH req
,FIRST emp WHERE emp.emp_nr = req.req_registered_by
,FIRST bemp WHERE bemp.emp_nr = req.req_treated_by
,FIRST cemp WHERE cemp.emp_nr = req.req_owner_nr
"

And the buffers;
CREATE BUFFER bh FOR TABLE tablename NO-ERROR.
CREATE BUFFER bi FOR TABLE tablename1 NO-ERROR.
CREATE BUFFER bj FOR TABLE tablename2 NO-ERROR.
CREATE BUFFER bk FOR TABLE tablename3 NO-ERROR.

in which the tablenames in this case were filled with a buffer
on "req" and three times on "emp", being the "emp", "bemp" and "cemp" buffers from the query....

Now I'm stuck.......Progress correctly doesn't allow the situation........

DEF BUFFER bemp FOR emp.
CREATE BUFFER bh FOR TABLE bemp NO-ERROR.

A double buffer so to say........
But how can I achieve a situation in which I CAN define multiple buffers on the same table and still !!! can distinguish these buffers in the
QUERY-PREPARE clause I use...

Do I really have to make use of a temptable for such a simple query ???

F. v.d. Meulen
Caesar Vitalogic
The Netherlands
 
Thanks!!... This probably solves my problem....I'll try this tomorrow right away...;)

Originally posted by Norman Biggar
I think the syntax you are looking for is

CREATE BUFFER bh FOR TABLE "emp" BUFFER-NAME "bemp".
 
Back
Top