Reputation: 1660
I need to convert a number of queries and functions from Progress / 4GL to SQL.
Can you help me get started, please? Here is one of the 4GL statements I need to convert.
for each Part where (
Part.NonStock = false AND
Part.InActive = false AND
Part.QtyBearing = true) no-lock ,
each PartWhse outer-join where (
Part.Company = PartWhse.Company and
Part.PartNum = PartWhse.PartNum) no-lock ,
each PartCost outer-join where (
Part.Company = PartCost.Company and
Part.PartNum = PartCost.PartNum) no-lock .
Can you explain the 4GL bits and give some hints as to what the SQL would look like.
I have some SQL knowledge, but next to no 4GL knowledge.
Upvotes: 2
Views: 1941
Reputation: 7344
select *
from part p
left outer join partwhse w on p.Company = w.Company
left outer join partCost c on p.Company = c.Company and p.PartNum = c.PartNum
where p.NonStock = false
and p.Inactive = false
and p.QtyBearing = true;
The no-lock bits would just add with (no lock) to the table declarations which isn't good practice and I'd avoid unless really needed.
Upvotes: 2