How to query same table twice in Progess OpenEdge Procedure?

Status
Not open for further replies.
F

FancyPanda

Guest
In this example, I have two tables; Order Header (oe-hdr) and Location (location). The order header table contains two fields (sale-location-key and ship-location-key) which have an associated location name in the location table. If I were to use SQL to get my results, I would do something like this..

SELECT oe-hdr.order-num, oe-hdr.order-date, saleloc.location-name, shiploc.location-name
FROM oe-hdr,
(SELECT location.location-name
FROM oe-hdr, location
WHERE oe-hdr.sale-location-key = location-key) as saleloc,
(SELECT location.location-name
FROM oe-hdr, location
WHERE oe-hdr.ship-location-key = location-key) as shiploc
WHERE oe-hdr.order-num = saleloc.order-num
AND oe-hdr.order-num = shiploc.order-num


Does anyone know how to replicate this in a Progress procedure?

Continue reading...
 
Status
Not open for further replies.
Top